|
|
6ae9ed |
From 3b8e838edb8ca856d25dd2e0ce29d1082527d087 Mon Sep 17 00:00:00 2001
|
|
|
6ae9ed |
Message-Id: <3b8e838edb8ca856d25dd2e0ce29d1082527d087@dist-git>
|
|
|
6ae9ed |
From: Michal Privoznik <mprivozn@redhat.com>
|
|
|
6ae9ed |
Date: Mon, 25 Jul 2016 12:42:47 -0400
|
|
|
6ae9ed |
Subject: [PATCH] virStorageEncryptionSecretFree: Don't leak secret lookup
|
|
|
6ae9ed |
definition
|
|
|
6ae9ed |
|
|
|
6ae9ed |
https://bugzilla.redhat.com/show_bug.cgi?id=1301021
|
|
|
6ae9ed |
|
|
|
6ae9ed |
When storage secret is parsed in virStorageEncryptionSecretParse(),
|
|
|
6ae9ed |
virSecretLookupParseSecret() which allocates some memory. This is
|
|
|
6ae9ed |
however never freed.
|
|
|
6ae9ed |
|
|
|
6ae9ed |
==21711== 134 bytes in 6 blocks are definitely lost in loss record 70 of 85
|
|
|
6ae9ed |
==21711== at 0x4C29F80: malloc (vg_replace_malloc.c:296)
|
|
|
6ae9ed |
==21711== by 0xBCA0356: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4)
|
|
|
6ae9ed |
==21711== by 0xA9F432E: virXMLPropString (virxml.c:479)
|
|
|
6ae9ed |
==21711== by 0xA9D25B0: virSecretLookupParseSecret (virsecret.c:70)
|
|
|
6ae9ed |
==21711== by 0xA9D616E: virStorageEncryptionSecretParse (virstorageencryption.c:172)
|
|
|
6ae9ed |
==21711== by 0xA9D66B2: virStorageEncryptionParseXML (virstorageencryption.c:281)
|
|
|
6ae9ed |
==21711== by 0xA9D68DF: virStorageEncryptionParseNode (virstorageencryption.c:338)
|
|
|
6ae9ed |
==21711== by 0xAA12575: virDomainDiskDefParseXML (domain_conf.c:7606)
|
|
|
6ae9ed |
==21711== by 0xAA2CAC6: virDomainDefParseXML (domain_conf.c:16658)
|
|
|
6ae9ed |
==21711== by 0xAA2FC75: virDomainDefParseNode (domain_conf.c:17472)
|
|
|
6ae9ed |
==21711== by 0xAA2FAE4: virDomainDefParse (domain_conf.c:17419)
|
|
|
6ae9ed |
==21711== by 0xAA2FB72: virDomainDefParseFile (domain_conf.c:17443)
|
|
|
6ae9ed |
|
|
|
6ae9ed |
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
6ae9ed |
(cherry picked from commit b04835258f3ea97c37f6a1aed370c6a2b29c58b2)
|
|
|
6ae9ed |
Signed-off-by: John Ferlan <jferlan@redhat.com>
|
|
|
6ae9ed |
---
|
|
|
6ae9ed |
src/util/virstorageencryption.c | 1 +
|
|
|
6ae9ed |
1 file changed, 1 insertion(+)
|
|
|
6ae9ed |
|
|
|
6ae9ed |
diff --git a/src/util/virstorageencryption.c b/src/util/virstorageencryption.c
|
|
|
6ae9ed |
index afb44da..cd17554 100644
|
|
|
6ae9ed |
--- a/src/util/virstorageencryption.c
|
|
|
6ae9ed |
+++ b/src/util/virstorageencryption.c
|
|
|
6ae9ed |
@@ -50,6 +50,7 @@ virStorageEncryptionSecretFree(virStorageEncryptionSecretPtr secret)
|
|
|
6ae9ed |
{
|
|
|
6ae9ed |
if (!secret)
|
|
|
6ae9ed |
return;
|
|
|
6ae9ed |
+ virSecretLookupDefClear(&secret->seclookupdef);
|
|
|
6ae9ed |
VIR_FREE(secret);
|
|
|
6ae9ed |
}
|
|
|
6ae9ed |
|
|
|
6ae9ed |
--
|
|
|
6ae9ed |
2.9.2
|
|
|
6ae9ed |
|