]> 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)
committerCole Robinson <crobinso@redhat.com>
Sun, 12 Aug 2012 23:22:51 +0000 (19:22 -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.

(cherry picked from commit b1675bac67c590ffd68b38a6fdacc66442ca7b8c)

src/conf/nwfilter_conf.c

index 07edf19fd32597987c80d6e42d8ad6d744ad911b..724d33e2309e2d798396f407986b82b60ab8edbe 100644 (file)
@@ -375,6 +375,7 @@ virNWFilterRuleDefAddVar(virNWFilterRuleDefPtr nwf,
 
     if (VIR_EXPAND_N(nwf->varAccess, nwf->nVarAccess, 1) < 0) {
         virReportOOMError();
+        virNWFilterVarAccessFree(varAccess);
         return -1;
     }