Commit f4a3579f authored by Frediano Ziglio's avatar Frediano Ziglio Committed by Frediano Ziglio

Use proper free function for PK11_ReadRawAttribute call

As documented in PK11_ReadRawAttribute data should be freed with
PORT_Free, not free or g_free.
Signed-off-by: 's avatarFrediano Ziglio <fziglio@redhat.com>
Acked-by: 's avatarChristophe Fergeau <cfergeau@redhat.com>
parent 03d3dd61
......@@ -1313,6 +1313,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);
......@@ -1331,7 +1332,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) {
......@@ -1352,8 +1353,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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment