gnutls-devel
[Top][All Lists]
Advanced

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

[gnutls-dev] Memory leeks?


From: Simon Posnjak
Subject: [gnutls-dev] Memory leeks?
Date: Fri, 27 Aug 2004 01:24:00 +0200

Hi,

I have written a small HTTP server and secured it with GNU TLS. When I
checked it for memory leeks with valgrind i discovered that gnutls
(libgrypt) seams to be leaking. My HTTP server dose not leek (when I
compile it without TLS suport valgrid shows 0 leaked memory and 0 still
reachable). I am all so worried about a large number of still reachable
memory which seams to belong to the libgcrypt. At the end of my program
I call:

gnutls_certificate_free_credentials(http_server_x509_cred);
gnutls_dh_params_deinit(http_server_dh_params);
gnutls_global_deinit();

Which take care of the gnutls allocated memory, but how do I get rid of the 
memory that libgcrypt allocated (I can not find the function to do that)?

The valgrind output (I would like to free the still reachable memory):

==9528== malloc/free: in use at exit: 2962 bytes in 47 blocks.
==9528== malloc/free: 18939 allocs, 18892 frees, 2522428 bytes allocated.
==9528==
==9528== searching for pointers to 47 not-freed blocks.
==9528== checked 4415664 bytes.
==9528==
==9528==
==9528== 62 bytes in 1 blocks are definitely lost in loss record 1 of 6
==9528==    at 0x4002ACB4: malloc (in /usr/lib/valgrind/vgskin_memcheck.so)
==9528==    by 0x806BAEF: generate_rdn_seq (in 
/stuff1/delo/carneol-cpot/carneol/blocks/http_server_block/tests/simple_web_server_tls/simple_http_tls)
==9528==    by 0x806CBB1: gnutls_certificate_set_x509_trust_file (in 
/stuff1/delo/carneol-cpot/carneol/blocks/http_server_block/tests/simple_web_server_tls/simple_http_tls)
==9528==    by 0x804A3C2: thread_http (thread_http.c:82)
==9528==
==9528==
==9528== 100 bytes in 5 blocks are definitely lost in loss record 2 of 6
==9528==    at 0x4002ACB4: malloc (in /usr/lib/valgrind/vgskin_memcheck.so)
==9528==    by 0x808A843: _gcry_malloc (global.c:394)
==9528==    by 0x808A9DB: gcry_malloc (global.c:412)
==9528==    by 0x808AA00: gcry_xmalloc (global.c:539)
==9528==
==9528==
==9528== 144 bytes in 6 blocks are still reachable in loss record 3 of 6
==9528==    at 0x4002ACB4: malloc (in /usr/lib/valgrind/vgskin_memcheck.so)
==9528==    by 0x8049FA2: gcry_pthread_mutex_init (thread_http.c:23)
==9528==    by 0x808DE77: _gcry_ath_init (ath.c:67)
==9528==    by 0x808AC2E: global_init (global.c:68)
==9528==
==9528==
==9528== 528 bytes in 4 blocks are still reachable in loss record 4 of 6
==9528==    at 0x4002B236: realloc (in /usr/lib/valgrind/vgskin_memcheck.so)
==9528==    by 0x808A746: gcry_realloc (global.c:455)
==9528==    by 0x808A768: gcry_xrealloc (global.c:553)
==9528==    by 0x80AC801: _gcry_mpi_resize (mpiutil.c:131)
==9528==
==9528==
==9528== 672 bytes in 28 blocks are still reachable in loss record 5 of 6
==9528==    at 0x4002ACB4: malloc (in /usr/lib/valgrind/vgskin_memcheck.so)
==9528==    by 0x808A84E: _gcry_malloc (global.c:396)
==9528==    by 0x808A9DB: gcry_malloc (global.c:412)
==9528==    by 0x80B0E2A: _gcry_module_add (module.c:77)
==9528==
==9528==
==9528== 1456 bytes in 3 blocks are still reachable in loss record 6 of 6
==9528==    at 0x4002ACB4: malloc (in /usr/lib/valgrind/vgskin_memcheck.so)
==9528==    by 0x808A843: _gcry_malloc (global.c:394)
==9528==    by 0x808A9DB: gcry_malloc (global.c:412)
==9528==    by 0x808AA00: gcry_xmalloc (global.c:539)
==9528==
==9528== LEAK SUMMARY:
==9528==    definitely lost: 162 bytes in 6 blocks.
==9528==    possibly lost:   0 bytes in 0 blocks.
==9528==    still reachable: 2800 bytes in 41 blocks.
==9528==         suppressed: 0 bytes in 0 blocks.
--9528--     TT/TC: 0 tc sectors discarded.
--9528--            7774 chainings, 0 unchainings.

                Regards Simon





reply via email to

[Prev in Thread] Current Thread [Next in Thread]