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.
This commit is contained in:
Jim Meyering
2008-01-29 17:41:07 +00:00
parent b17caa80d1
commit acff2d11ac
26 changed files with 143 additions and 211 deletions

View File

@@ -83,8 +83,7 @@ virtTestRun(const char *title, int nloops, int (*body)(const void *data), const
else
fprintf(stderr, "%-50s ... FAILED\n", title);
if (ts)
free(ts);
free(ts);
return ret;
}

View File

@@ -62,8 +62,7 @@ static int testCompareFiles(const char *hostmachine,
fail:
if (actualxml)
free(actualxml);
free(actualxml);
if (fp1)
fclose(fp1);
if (fp2)

View File

@@ -153,8 +153,7 @@ static int testCompareFormatXML(const char *xmcfg_rel, const char *xml_rel,
fail:
if (conf)
virConfFree(conf);
if (gotxml)
free(gotxml);
free(gotxml);
if (conn) {
conn->privateData = old_priv;