]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cleanup: remove useless if-before-VIR_FREE
authorJim Meyering <meyering@redhat.com>
Tue, 3 Feb 2009 13:08:07 +0000 (13:08 +0000)
committerJim Meyering <meyering@redhat.com>
Tue, 3 Feb 2009 13:08:07 +0000 (13:08 +0000)
* Makefile.cfg (useless_free_options): Also check for VIR_FREE.
* src/iptables.c (iptRulesFree): Remove useless if-before-VIR_FREE.
* src/remote_internal.c (remoteAuthSASL): Likewise.
* src/test.c (testOpenFromFile): Likewise.

ChangeLog
Makefile.cfg
src/iptables.c
src/remote_internal.c
src/test.c

index 6c0fedbfde8f922f9da363fca589f71161fb2665..dc443209c1b86ffb99ca47d5cfd2c4604180e9ea 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Tue, 3 Feb 2009 14:06:05 +0100 Jim Meyering <meyering@redhat.com>
+
+       cleanup: remove useless if-before-VIR_FREE
+       * Makefile.cfg (useless_free_options): Also check for VIR_FREE.
+       * src/iptables.c (iptRulesFree): Remove useless if-before-VIR_FREE.
+       * src/remote_internal.c (remoteAuthSASL): Likewise.
+       * src/test.c (testOpenFromFile): Likewise.
+
 Mon, 2 Feb 2009 21:33:57 +0100 Jim Meyering <meyering@redhat.com>
 
        tests: diagnose more open failures
index 44d3898c2ac736ee7909b3635811c1548e3f0220..d9bccd203f812ba044b86272152891efa30ec6bb 100644 (file)
@@ -59,6 +59,7 @@ local-checks-to-skip =                        \
 
 useless_free_options =         \
   --name=sexpr_free            \
+  --name=VIR_FREE              \
   --name=xmlFree               \
   --name=xmlXPathFreeContext   \
   --name=xmlXPathFreeObject
index ad7fddf1bfe0fd7fc404a6db506680a2e0fea5d9..c850b9ecb7c3dea6a82b72f982c41a050c711020 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007, 2008 Red Hat, Inc.
+ * Copyright (C) 2007-2009 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -325,11 +325,8 @@ iptRulesFree(iptRules *rules)
 {
     int i;
 
-    if (rules->table)
-        VIR_FREE(rules->table);
-
-    if (rules->chain)
-        VIR_FREE(rules->chain);
+    VIR_FREE(rules->table);
+    VIR_FREE(rules->chain);
 
     if (rules->rules) {
         for (i = 0; i < rules->nrules; i++)
index b6e963af8500972871ceb9de9ae8d937d45881ca..a14822ae4868de72cc600a3b9e75a296e6809443 100644 (file)
@@ -5388,9 +5388,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
             goto cleanup;
         }
 
-        if (serverin) {
-            VIR_FREE(serverin);
-        }
+        VIR_FREE(serverin);
         DEBUG("Client step result %d. Data %d bytes %p", err, clientoutlen, clientout);
 
         /* Previous server call showed completion & we're now locally complete too */
index 59b9370f55e45c5a0df54cafefa96ba830ae3228..0e0ec7c400b4cff4a6bb69b5921b353554b29c11 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * test.c: A "mock" hypervisor for use by application unit tests
  *
- * Copyright (C) 2006-2008 Red Hat, Inc.
+ * Copyright (C) 2006-2009 Red Hat, Inc.
  * Copyright (C) 2006 Daniel P. Berrange
  *
  * This library is free software; you can redistribute it and/or
@@ -509,8 +509,7 @@ static int testOpenFromFile(virConnectPtr conn,
         dom->persistent = 1;
         virDomainObjUnlock(dom);
     }
-    if (domains != NULL)
-        VIR_FREE(domains);
+    VIR_FREE(domains);
 
     ret = virXPathNodeSet(conn, "/node/network", ctxt, &networks);
     if (ret < 0) {
@@ -544,8 +543,7 @@ static int testOpenFromFile(virConnectPtr conn,
         net->persistent = 1;
         virNetworkObjUnlock(net);
     }
-    if (networks != NULL)
-        VIR_FREE(networks);
+    VIR_FREE(networks);
 
     /* Parse Storage Pool list */
     ret = virXPathNodeSet(conn, "/node/pool", ctxt, &pools);
@@ -599,8 +597,7 @@ static int testOpenFromFile(virConnectPtr conn,
         pool->active = 1;
         virStoragePoolObjUnlock(pool);
     }
-    if (pools != NULL)
-        VIR_FREE(pools);
+    VIR_FREE(pools);
 
     xmlXPathFreeContext(ctxt);
     xmlFreeDoc(xml);