c1c534
From e795a37abe3dab75cfb48d9b514cd3d42a2b7722 Mon Sep 17 00:00:00 2001
c1c534
Message-Id: <e795a37abe3dab75cfb48d9b514cd3d42a2b7722@dist-git>
c1c534
From: Michal Privoznik <mprivozn@redhat.com>
c1c534
Date: Fri, 1 Dec 2017 15:48:37 +0100
c1c534
Subject: [PATCH] virDomainDiskSourceNetworkParse: Don't leak @tlsCfg or
c1c534
 @haveTLS
c1c534
c1c534
==861== 3 bytes in 1 blocks are definitely lost in loss record 3 of 168
c1c534
==861==    at 0x4C2AEDF: malloc (vg_replace_malloc.c:299)
c1c534
==861==    by 0x8C7FBC8: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4)
c1c534
==861==    by 0x5DCCDC2: virXMLPropString (virxml.c:510)
c1c534
==861==    by 0x5DF1232: virDomainDiskSourceNetworkParse (domain_conf.c:8445)
c1c534
==861==    by 0x5DF1728: virDomainDiskSourceParse (domain_conf.c:8576)
c1c534
==861==    by 0x5DF41A5: virDomainDiskDefParseXML (domain_conf.c:9238)
c1c534
==861==    by 0x5E1119F: virDomainDefParseXML (domain_conf.c:19233)
c1c534
==861==    by 0x5E146EE: virDomainDefParseNode (domain_conf.c:20083)
c1c534
==861==    by 0x5E14540: virDomainDefParse (domain_conf.c:20027)
c1c534
==861==    by 0x5E145E6: virDomainDefParseFile (domain_conf.c:20053)
c1c534
==861==    by 0x4053CC: testCompareXMLToArgv (qemuxml2argvtest.c:455)
c1c534
==861==    by 0x41F135: virTestRun (testutils.c:180)
c1c534
c1c534
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
c1c534
(cherry picked from commit 7d7c01b4580f471e1376e30d4092dcf45cfe0ccc)
c1c534
c1c534
https://bugzilla.redhat.com/show_bug.cgi?id=1519759
c1c534
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c1c534
---
c1c534
 src/conf/domain_conf.c | 2 ++
c1c534
 1 file changed, 2 insertions(+)
c1c534
c1c534
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
c1c534
index ec138ea861..3bb66e4326 100644
c1c534
--- a/src/conf/domain_conf.c
c1c534
+++ b/src/conf/domain_conf.c
c1c534
@@ -8489,6 +8489,8 @@ virDomainDiskSourceNetworkParse(xmlNodePtr node,
c1c534
     ret = 0;
c1c534
 
c1c534
  cleanup:
c1c534
+    VIR_FREE(tlsCfg);
c1c534
+    VIR_FREE(haveTLS);
c1c534
     VIR_FREE(protocol);
c1c534
     return ret;
c1c534
 }
c1c534
-- 
c1c534
2.15.1
c1c534