[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] gentypes: make dispose function tolerate NULL



commit a5dfa16ba4acf1d8994f462b2b8c9ab4c4f147d2
Author:     Wei Liu <wei.liu2@xxxxxxxxxx>
AuthorDate: Wed Feb 25 14:56:04 2015 +0000
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Mon Mar 2 17:05:39 2015 +0000

    gentypes: make dispose function tolerate NULL
    
    Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
    Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/libxl/gentypes.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/gentypes.py b/tools/libxl/gentypes.py
index afd4eea..00816c0 100644
--- a/tools/libxl/gentypes.py
+++ b/tools/libxl/gentypes.py
@@ -642,6 +642,7 @@ if __name__ == '__main__':
     for ty in [t for t in types if t.dispose_fn is not None and 
t.autogenerate_dispose_fn]:
         f.write("void %s(%s)\n" % (ty.dispose_fn, ty.make_arg("p")))
         f.write("{\n")
+        f.write("    if (!p) return;\n")
         f.write(libxl_C_type_dispose(ty, "p"))
         f.write("    memset(p, 0, sizeof(*p));\n")
         f.write("}\n")
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.