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.
This commit is contained in:
Jim Meyering 2008-07-19 07:42:34 +00:00
parent cff27e9f40
commit 3ff5480d7b
6 changed files with 15 additions and 17 deletions

View File

@ -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

View 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)

View 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;
}
}

View 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;
}

View 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);

View 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);
}