[PATCH] Use proper free function for PK11_ReadRawAttribute call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/cac.c            | 3 ++-
 src/vcard_emul_nss.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/cac.c b/src/cac.c
index ba63685..6c49d9b 100644
--- a/src/cac.c
+++ b/src/cac.c
@@ -21,6 +21,7 @@
 
 #include <string.h>
 #include <stdbool.h>
+#include <nss.h>
 
 #include "cac.h"
 #include "cac-aca.h"
@@ -728,7 +729,7 @@ cac_passthrough_container_process_apdu(VCard *card, VCardAPDU *apdu,
             data = vcard_emul_read_object(card, pt_applet->label, &data_len);
             if (data) {
                 tlv = simpletlv_parse(data, data_len, &tlv_len);
-                g_free(data);
+                PORT_Free(data);
 
                 /* break the data buffer to TL and V buffers */
                 applet_private->tag_buffer_len = cac_create_tl_file(tlv, tlv_len,
diff --git a/src/vcard_emul_nss.c b/src/vcard_emul_nss.c
index 9658c5a..b750dce 100644
--- a/src/vcard_emul_nss.c
+++ b/src/vcard_emul_nss.c
@@ -1330,7 +1330,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) {
-- 
2.17.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]