[Spice-devel] [cacard 3/5] vcard-emul-nss: Fix VCardKey leak

Christophe Fergeau cfergeau at redhat.com
Tue Aug 21 15:07:37 UTC 2018


vcard_emul_make_key() allocates memory for the VCardKey structure, but
vcard_emul_delete_key never frees that memory. Since VCardKey definition
is private to vcard-emul-nss.c, there are no users which could use a
stack-allocated VCardKey.

Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
---
 src/vcard_emul_nss.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/vcard_emul_nss.c b/src/vcard_emul_nss.c
index 9658c5a..e59274d 100644
--- a/src/vcard_emul_nss.c
+++ b/src/vcard_emul_nss.c
@@ -177,6 +177,7 @@ vcard_emul_delete_key(VCardKey *key)
     if (key->slot) {
         PK11_FreeSlot(key->slot);
     }
+    g_free(key);
 }
 
 /*
-- 
2.17.1



More information about the Spice-devel mailing list