]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
nwfilter: Fix memory leak
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Fri, 29 Jun 2012 18:36:15 +0000 (14:36 -0400)
committerStefan Berger <stefanb@us.ibm.com>
Fri, 29 Jun 2012 18:36:15 +0000 (14:36 -0400)
Below patch fixes this coverity report:

/libvirt/src/conf/nwfilter_conf.c:382:
leaked_storage: Variable "varAccess" going out of scope leaks the storage it points to.

src/conf/nwfilter_conf.c

index 8729f9c1644c86ab98ab329f9039a42f612e9df4..57e5593d6fe701638aadc25fa17aff6a79ebf104 100644 (file)
@@ -379,6 +379,7 @@ virNWFilterRuleDefAddVar(virNWFilterRuleDefPtr nwf,
 
     if (VIR_EXPAND_N(nwf->varAccess, nwf->nVarAccess, 1) < 0) {
         virReportOOMError();
+        virNWFilterVarAccessFree(varAccess);
         return -1;
     }