Colin Leroy | 4 Jul 14:05
Face

[PATCH] Little leak fix

Hello,

I've found out this via valgrind:

==5806== 7,698 (504 direct, 7,194 indirect) bytes in 9 blocks are 
         definitely lost in loss record 175 of 248
==5806==    at 0x4C220BC: calloc (vg_replace_malloc.c:397)
==5806==    by 0xED2FE11: _asn1_add_node_only (structure.c:54)
==5806==    by 0xED2FFF2: _asn1_copy_structure3 (structure.c:398)
==5806==    by 0xED3038D: asn1_create_element (structure.c:690)
==5806==    by 0x9733F7A: _gnutls_x509_decode_octet_string (common.c:832)
==5806==    by 0x9734243: _gnutls_x509_read_value (common.c:912)
==5806==    by 0x974756E: _decode_pkcs12_auth_safe (pkcs12.c:76)
==5806==    by 0x9748A67: gnutls_pkcs12_get_bag (pkcs12.c:598)

Attached is a patch which fixes it.

HTH,
--

-- 
Colin
--- lib/x509/common.c.orig	2008-07-04 13:59:20.000000000 +0200
+++ lib/x509/common.c	2008-07-04 13:59:13.000000000 +0200
@@ -856,6 +856,9 @@ _gnutls_x509_decode_octet_string (const 
       goto cleanup;
     }

+  if (c2)
+    asn1_delete_structure (&c2);
(Continue reading)

Re: [PATCH] Little leak fix

Colin Leroy wrote:
> Hello,
> 
> I've found out this via valgrind:
> 
> ==5806== 7,698 (504 direct, 7,194 indirect) bytes in 9 blocks are 
>          definitely lost in loss record 175 of 248
> ==5806==    at 0x4C220BC: calloc (vg_replace_malloc.c:397)
> ==5806==    by 0xED2FE11: _asn1_add_node_only (structure.c:54)
> ==5806==    by 0xED2FFF2: _asn1_copy_structure3 (structure.c:398)
> ==5806==    by 0xED3038D: asn1_create_element (structure.c:690)
> ==5806==    by 0x9733F7A: _gnutls_x509_decode_octet_string (common.c:832)
> ==5806==    by 0x9734243: _gnutls_x509_read_value (common.c:912)
> ==5806==    by 0x974756E: _decode_pkcs12_auth_safe (pkcs12.c:76)
> ==5806==    by 0x9748A67: gnutls_pkcs12_get_bag (pkcs12.c:598)
> 
> Attached is a patch which fixes it.

Thank you for the patch. It was applied (slightly modified)!

regards,
Nikos

Gmane