From: John Ferlan Date: Fri, 9 Jan 2015 12:38:17 +0000 (-0500) Subject: openvz: Resolve Coverity RESOURCE_LEAK X-Git-Tag: v1.2.12-rc1~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21160a7ac9140c431463aceb2b24f5506361472a;p=thirdparty%2Flibvirt.git openvz: Resolve Coverity RESOURCE_LEAK 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 --- diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index c144ecacf3..64f5219fd9 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -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); } }