render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
a41c76
From 4fd89121cecafd23bb45c517d5b8ff90d9b40a8f Mon Sep 17 00:00:00 2001
a41c76
Message-Id: <4fd89121cecafd23bb45c517d5b8ff90d9b40a8f@dist-git>
a41c76
From: Michal Privoznik <mprivozn@redhat.com>
a41c76
Date: Wed, 4 Mar 2020 12:42:34 +0100
a41c76
Subject: [PATCH] virDomainFSDefFree: Unref private data
a41c76
MIME-Version: 1.0
a41c76
Content-Type: text/plain; charset=UTF-8
a41c76
Content-Transfer-Encoding: 8bit
a41c76
a41c76
The privateData object is allocated in virDomainFSDefNew() but
a41c76
never unref'd.
a41c76
a41c76
==119642== 480 bytes in 20 blocks are definitely lost in loss record 656 of 671
a41c76
==119642==    at 0x4837B86: calloc (vg_replace_malloc.c:762)
a41c76
==119642==    by 0x57806A0: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.6000.7)
a41c76
==119642==    by 0x4AE7392: virAllocVar (viralloc.c:331)
a41c76
==119642==    by 0x4B64395: virObjectNew (virobject.c:241)
a41c76
==119642==    by 0x48F1464: qemuDomainFSPrivateNew (qemu_domain.c:1427)
a41c76
==119642==    by 0x4BBF004: virDomainFSDefNew (domain_conf.c:2307)
a41c76
==119642==    by 0x4BD859A: virDomainFSDefParseXML (domain_conf.c:11217)
a41c76
==119642==    by 0x4BF9DD1: virDomainDefParseXML (domain_conf.c:21179)
a41c76
==119642==    by 0x4BFCD5B: virDomainDefParseNode (domain_conf.c:21943)
a41c76
==119642==    by 0x4BFCC36: virDomainDefParse (domain_conf.c:21901)
a41c76
==119642==    by 0x4BFCCCB: virDomainDefParseFile (domain_conf.c:21924)
a41c76
==119642==    by 0x114A9D: testCompareXMLToArgv (qemuxml2argvtest.c:452)
a41c76
a41c76
Fixes: 5120577ed79f89e172e3deed534fa9b585f4701f
a41c76
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
(cherry picked from commit d8b4f70e1e36772ef82dbe0f0706fa7845583e6c)
a41c76
Signed-off-by: Ján Tomko <jtomko@redhat.com>
a41c76
https://bugzilla.redhat.com/show_bug.cgi?id=1694166
a41c76
Message-Id: <77519310a2e8c09b41bfcc0c8e37b1c2dcb35b5c.1583322090.git.jtomko@redhat.com>
a41c76
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
a41c76
---
a41c76
 src/conf/domain_conf.c | 1 +
a41c76
 1 file changed, 1 insertion(+)
a41c76
a41c76
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
a41c76
index 88117187c8..990c5bcc1e 100644
a41c76
--- a/src/conf/domain_conf.c
a41c76
+++ b/src/conf/domain_conf.c
a41c76
@@ -2320,6 +2320,7 @@ void virDomainFSDefFree(virDomainFSDefPtr def)
a41c76
     VIR_FREE(def->dst);
a41c76
     virDomainDeviceInfoClear(&def->info);
a41c76
     VIR_FREE(def->virtio);
a41c76
+    virObjectUnref(def->privateData);
a41c76
 
a41c76
     VIR_FREE(def);
a41c76
 }
a41c76
-- 
a41c76
2.25.1
a41c76