diff options
author | Jim Meyering <meyering@redhat.com> | 2008-01-29 17:41:07 +0000 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2008-01-29 17:41:07 +0000 |
commit | acff2d11ac4fe1fe97d06aa9d21e77408e0ba688 (patch) | |
tree | e4244f2eba83eb77e3f9008f11c11464e2eb97df /python/generator.py | |
parent | Clarify virsh documentation. (diff) | |
download | libvirt-acff2d11ac4fe1fe97d06aa9d21e77408e0ba688.tar.gz libvirt-acff2d11ac4fe1fe97d06aa9d21e77408e0ba688.tar.bz2 libvirt-acff2d11ac4fe1fe97d06aa9d21e77408e0ba688.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 'python/generator.py')
-rwxr-xr-x | python/generator.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/python/generator.py b/python/generator.py index 7625a936b..30b03fdb5 100755 --- a/python/generator.py +++ b/python/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]) |