]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
openvz: Resolve Coverity RESOURCE_LEAK
authorJohn Ferlan <jferlan@redhat.com>
Fri, 9 Jan 2015 12:38:17 +0000 (07:38 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 12 Jan 2015 13:59:54 +0000 (08:59 -0500)
Commit id 'a4e86390' modified the command line to allow --ipadd multiple
times, which caused Coverity to notice a latent memory leak with the
'ipAddr' string not being VIR_FREE()'d

Signed-off-by: John Ferlan <jferlan@redhat.com>
src/openvz/openvz_driver.c

index c144ecacf3aeafb033519e7e311b66e576fcb142..64f5219fd9408e7467c49ecc209bc5d989ea50c0 100644 (file)
@@ -911,6 +911,7 @@ openvzDomainSetNetwork(virConnectPtr conn, const char *vpsid,
         for (i = 0; i < net->nips; i++) {
             char *ipStr = virSocketAddrFormat(&net->ips[i]->address);
             virCommandAddArgList(cmd, "--ipadd", ipStr, NULL);
+            VIR_FREE(ipStr);
         }
     }