render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
404507
From 0d914e2528519ec2130a01017b32c373964fb825 Mon Sep 17 00:00:00 2001
404507
Message-Id: <0d914e2528519ec2130a01017b32c373964fb825@dist-git>
404507
From: Michal Privoznik <mprivozn@redhat.com>
404507
Date: Fri, 1 Dec 2017 15:48:38 +0100
404507
Subject: [PATCH] virDomainDiskBackingStoreParse: Don't leak @idx
404507
404507
==1277== 8 bytes in 4 blocks are definitely lost in loss record 39 of 131
404507
==1277==    at 0x4C2AEDF: malloc (vg_replace_malloc.c:299)
404507
==1277==    by 0x68BBBC8: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4)
404507
==1277==    by 0x53B1DC2: virXMLPropString (virxml.c:510)
404507
==1277==    by 0x53D696A: virDomainDiskBackingStoreParse (domain_conf.c:8639)
404507
==1277==    by 0x53DA684: virDomainDiskDefParseXML (domain_conf.c:9590)
404507
==1277==    by 0x53F619F: virDomainDefParseXML (domain_conf.c:19233)
404507
==1277==    by 0x53F96EE: virDomainDefParseNode (domain_conf.c:20083)
404507
==1277==    by 0x53F9540: virDomainDefParse (domain_conf.c:20027)
404507
==1277==    by 0x53F95E6: virDomainDefParseFile (domain_conf.c:20053)
404507
==1277==    by 0x44D1D4: testCompareDomXML2XMLFiles (testutils.c:1265)
404507
==1277==    by 0x42FC7C: testXML2XMLActive (qemuxml2xmltest.c:71)
404507
==1277==    by 0x44AD20: virTestRun (testutils.c:180)
404507
404507
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
404507
(cherry picked from commit 0fd85b98aee9094bf61a2db86b795421119a41b5)
404507
404507
https://bugzilla.redhat.com/show_bug.cgi?id=1519759
404507
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
404507
---
404507
 src/conf/domain_conf.c | 1 +
404507
 1 file changed, 1 insertion(+)
404507
404507
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
404507
index 3bb66e4326..83392a42c0 100644
404507
--- a/src/conf/domain_conf.c
404507
+++ b/src/conf/domain_conf.c
404507
@@ -8671,6 +8671,7 @@ virDomainDiskBackingStoreParse(xmlXPathContextPtr ctxt,
404507
     virStorageSourceFree(backingStore);
404507
     VIR_FREE(type);
404507
     VIR_FREE(format);
404507
+    VIR_FREE(idx);
404507
     ctxt->node = save_ctxt;
404507
     return ret;
404507
 }
404507
-- 
404507
2.15.1
404507