]> xenbits.xensource.com Git - libvirt.git/commitdiff
remove unnecessary "V = NULL;" stmts after VIR_FREE(V)
authorJim Meyering <meyering@redhat.com>
Sat, 19 Jul 2008 07:42:34 +0000 (07:42 +0000)
committerJim Meyering <meyering@redhat.com>
Sat, 19 Jul 2008 07:42:34 +0000 (07:42 +0000)
* src/domain_conf.c (virDomainChrDefParseXML)
(virDomainNetDefParseXML): Likewise.
* src/iptables.c (iptRuleFree): Likewise.
* src/storage_backend.c (virStorageBackendRunProgRegex): Likewise.
* src/test.c (testOpenFromFile): Likewise.
* src/xmlrpc.c (xmlRpcCallRaw): Likewise.

ChangeLog
src/domain_conf.c
src/iptables.c
src/storage_backend.c
src/test.c
src/xmlrpc.c

index f0d29fd12dbd43a74df94f06839f0319fd4fcbac..b757a1032a614f72a1262c633d66c52ba76dd8c3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,14 @@
-Wed Jul 18 13:01:38 CEST 2008 Jim Meyering <meyering@redhat.com>
+Sat Jul 19 09:41:53 CEST 2008 Jim Meyering <meyering@redhat.com>
+
+       remove unnecessary "V = NULL;" stmts after VIR_FREE(V)
+       * src/domain_conf.c (virDomainChrDefParseXML)
+       (virDomainNetDefParseXML): Likewise.
+       * src/iptables.c (iptRuleFree): Likewise.
+       * src/storage_backend.c (virStorageBackendRunProgRegex): Likewise.
+       * src/test.c (testOpenFromFile): Likewise.
+       * src/xmlrpc.c (xmlRpcCallRaw): Likewise.
+
+Fri Jul 18 13:01:38 CEST 2008 Jim Meyering <meyering@redhat.com>
 
        enable format-safety checks for virDomainReportError
        * src/domain_conf.c (virDomainReportError): Declare using
index 2ff5d1a6985f2f6eebac04d490b491cd7ef25a04..f1396091934959b7899f5e1633f4c7ead7d1fcf4 100644 (file)
@@ -700,7 +700,6 @@ virDomainNetDefParseXML(virConnectPtr conn,
                 if (STRPREFIX((const char*)ifname, "vnet")) {
                     /* An auto-generated target name, blank it out */
                     VIR_FREE(ifname);
-                    ifname = NULL;
                 }
             } else if ((script == NULL) &&
                        (def->type == VIR_DOMAIN_NET_TYPE_ETHERNET) &&
@@ -958,10 +957,8 @@ virDomainChrDefParseXML(virConnectPtr conn,
                             bindService = virXMLPropString(cur, "service");
                     }
 
-                    if (def->type == VIR_DOMAIN_CHR_TYPE_UDP) {
+                    if (def->type == VIR_DOMAIN_CHR_TYPE_UDP)
                         VIR_FREE(mode);
-                        mode = NULL;
-                    }
                 }
             } else if (xmlStrEqual(cur->name, BAD_CAST "protocol")) {
                 if (protocol == NULL)
index e7613e2bed476ca225ccb46679cc2d6d899dde23..3e3a1a2261c6b41f303adb5756d8e94ecc962b5e 100644 (file)
@@ -266,14 +266,12 @@ static void
 iptRuleFree(iptRule *rule)
 {
     VIR_FREE(rule->rule);
-    rule->rule = NULL;
 
     if (rule->argv) {
         int i = 0;
         while (rule->argv[i])
             VIR_FREE(rule->argv[i++]);
         VIR_FREE(rule->argv);
-        rule->argv = NULL;
     }
 }
 
index 3e4e39cadd2a7f05c08adaa152acc77d5cf63b48..a164a08e561276b55c11a02c648b4e3bf73bf238 100644 (file)
@@ -444,10 +444,8 @@ virStorageBackendRunProgRegex(virConnectPtr conn,
                         goto cleanup;
 
                     /* Release matches & restart to matching the first regex */
-                    for (j = 0 ; j < totgroups ; j++) {
+                    for (j = 0 ; j < totgroups ; j++)
                         VIR_FREE(groups[j]);
-                        groups[j] = NULL;
-                    }
                     maxReg = 0;
                     ngroup = 0;
                 }
index d0bb00350b719de296251a45f2606383412f377e..b7b9df01502e8f38fa8cc233724e2851d3c38cbc 100644 (file)
@@ -461,10 +461,8 @@ static int testOpenFromFile(virConnectPtr conn,
         dom->def->id = privconn->nextDomID++;
         dom->persistent = 1;
     }
-    if (domains != NULL) {
+    if (domains != NULL)
         VIR_FREE(domains);
-        domains = NULL;
-    }
 
     ret = virXPathNodeSet("/node/network", ctxt, &networks);
     if (ret < 0) {
@@ -498,10 +496,8 @@ static int testOpenFromFile(virConnectPtr conn,
 
         net->persistent = 1;
     }
-    if (networks != NULL) {
+    if (networks != NULL)
         VIR_FREE(networks);
-        networks = NULL;
-    }
 
     xmlXPathFreeContext(ctxt);
     xmlFreeDoc(xml);
index d62760776a3935317835b1367c7a2cb702afc835..cbca38931a9142739ddba6d5599923cfe9e716f6 100644 (file)
@@ -443,7 +443,6 @@ static char *xmlRpcCallRaw(const char *url, const char *request)
         if (ret != len) {
                 errno = EINVAL;
                 VIR_FREE(response);
-                response = NULL;
                 xmlRpcError(VIR_ERR_POST_FAILED, _("read response"), 0);
         }