summaryrefslogtreecommitdiffstats
path: root/generator.py
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-01-29 17:41:07 +0000
committerJim Meyering <meyering@redhat.com>2008-01-29 17:41:07 +0000
commite652e9ec61426e803785c0b4309509bffe68408c (patch)
treedf923ae0bc7ced51cc38da8e07446d611ef0f3a7 /generator.py
parent56edce6413665a5b5184a27dbd836c5a735fb099 (diff)
downloadlibvirt-python-split-e652e9ec61426e803785c0b4309509bffe68408c.tar.gz
libvirt-python-split-e652e9ec61426e803785c0b4309509bffe68408c.tar.xz
libvirt-python-split-e652e9ec61426e803785c0b4309509bffe68408c.zip
Given code like if (foo) free (foo); remove the useless "if (foo) " part.
Likewise, given if (foo != NULL) free (foo); remove the useless "if" test. * proxy/libvirt_proxy.c: Remove unnecessary "if" test before free. * python/generator.py: Likewise. * qemud/qemud.c: Likewise. * src/buf.c: Likewise. * src/conf.c: Likewise. * src/hash.c: Likewise. * src/iptables.c: Likewise. * src/libvirt.c: Likewise. * src/openvz_conf.c: Likewise. * src/qemu_conf.c: Likewise. * src/qemu_driver.c: Likewise. * src/remote_internal.c: Likewise. * src/test.c: Likewise. * src/virsh.c: Likewise. * src/virterror.c: Likewise. * src/xen_internal.c: Likewise. * src/xen_unified.c: Likewise. * src/xend_internal.c: Likewise. * src/xm_internal.c: Likewise. * src/xml.c: Likewise. * src/xmlrpc.c: Likewise. * src/xs_internal.c: Likewise. * tests/testutils.c: Likewise. * tests/xencapstest.c: Likewise. * tests/xmconfigtest.c: Likewise.
Diffstat (limited to 'generator.py')
-rwxr-xr-xgenerator.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/generator.py b/generator.py
index 7625a93..30b03fd 100755
--- a/generator.py
+++ b/generator.py
@@ -375,7 +375,7 @@ def print_function_wrapper(name, output, export, include):
if ret[0] == 'void':
if file == "python_accessor":
if args[1][1] == "char *":
- c_call = "\n if (%s->%s != NULL) free(%s->%s);\n" % (
+ c_call = "\n free(%s->%s);\n" % (
args[0][0], args[1][0], args[0][0], args[1][0])
c_call = c_call + " %s->%s = (%s)strdup((const xmlChar *)%s);\n" % (args[0][0],
args[1][0], args[1][1], args[1][0])