[libvirt] [PATCHv2 6/7] domain_conf: Resolve Coverity RESOURCE_LEAK

Cédric Bosdonnat cbosdonnat at suse.com
Thu Jan 15 09:25:46 UTC 2015


From: John Ferlan <jferlan at redhat.com>

Commit id 'aa2cc721' added call to virSocketAddrFormat
and did not VIR_FREE() the returned memory.

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 src/conf/domain_conf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 3c5f279..d262d72 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -17198,6 +17198,7 @@ virDomainNetIpsFormat(virBufferPtr buf, virDomainNetIpDefPtr *ips, size_t nips)
             familyStr = "ipv4";
         virBufferAsprintf(buf, "<ip address='%s'",
                           ipStr);
+        VIR_FREE(ipStr);
         if (familyStr)
             virBufferAsprintf(buf, " family='%s'", familyStr);
         if (ips[i]->prefix != 0)
-- 
2.1.2




More information about the libvir-list mailing list