[Help-gnutls] GnuTLS 2.2.1 memory leaks or just bad usage?

Daniel Stenberg daniel at haxx.se
Sat Feb 16 14:11:43 CET 2008


On Sat, 16 Feb 2008, Nikos Mavrogiannopoulos wrote:

>> I get two different leaks reported, and while I'm not done researching
>> these I thought I'd post them here in case someone else wants to help out:
>
> Thank you for reporting this. Does the attached patch solve the leaks?

Thanks!

First it doesn't build, it needs a #include "gnutls_datum.h" in 
gnutls_session.c! (If you want me to, I can produce an updated patch that 
applies cleanly.)

Then, yes it _does_ fix the worst leaks in my test case. The reamining leak 
now looks like this (with a build using only -g and not -O2 that otherwise 
confuse symbols like the ones in my initial report):

==13872== 128 bytes in 1 blocks are definitely lost in loss record 2 of 8
==13872==    at 0x4022AB8: malloc (vg_replace_malloc.c:207)
==13872==    by 0x40FBC15: _gnutls_mpi_dprint_lz (gnutls_mpi.c:146)
==13872==    by 0x410B4C3: _gnutls_dh_set_peer_public (gnutls_state.c:474)
==13872==    by 0x411354E: _gnutls_proc_dh_common_server_kx 
(auth_dh_common.c:297)
==13872==    by 0x4108404: proc_dhe_server_kx (auth_dhe.c:199)
==13872==    by 0x40F079F: _gnutls_recv_server_kx_message (gnutls_kx.c:401)
==13872==    by 0x40EB332: _gnutls_handshake_client (gnutls_handshake.c:2342)
==13872==    by 0x40EADF9: gnutls_handshake (gnutls_handshake.c:2238)
==13872==    by 0x8083C40: handshake (gtls.c:156)
==13872==    by 0x80841D5: Curl_gtls_connect (gtls.c:326)
==13872==    by 0x806169A: Curl_ssl_connect (sslgen.c:215)
==13872==    by 0x806C605: Curl_http_connect (http.c:1700)






More information about the Gnutls-help mailing list