As documented in PK11_ReadRawAttribute data should be freed with PORT_Free, not free or g_free. Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx> --- src/vcard_emul_nss.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/vcard_emul_nss.c b/src/vcard_emul_nss.c index 9658c5a..43707d0 100644 --- a/src/vcard_emul_nss.c +++ b/src/vcard_emul_nss.c @@ -1312,6 +1312,7 @@ vcard_emul_read_object(VCard *card, const char *label, PK11GenericObject *obj, *firstObj, *myObj = NULL; SECItem result; SECStatus r; + unsigned char *ret; slot = vcard_emul_card_get_slot(card); @@ -1330,7 +1331,7 @@ vcard_emul_read_object(VCard *card, const char *label, && memcmp(label, result.data, result.len) == 0) found = 1; - free(result.data); + PORT_Free(result.data); result.data = NULL; if (found) { @@ -1351,8 +1352,9 @@ vcard_emul_read_object(VCard *card, const char *label, return NULL; *ret_len = result.len; - return result.data; - + ret = g_memdup(result.data, result.len); + PORT_Free(result.data); + return ret; } void -- 2.17.1 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel