Valgrind reports memory leaks

Pedro Lageira pedro.lageira at inov.pt
Fri Jan 26 12:30:49 CET 2007


Hi Brad Hards,

thanks for your help. I have replaced the line:
gcry_control(GCRYCTL_DISABLE_SECMEM, 0);
with the line:
gcry_control(GCRYCTL_INIT_SECMEM, 1);

But Valgrind still reports a memory leak:
591 bytes definitely lost (instead of 1,081 bytes).
I'm sending the end of the Valgrind output in attach.

Thanks,

Pedro Lageira
-------------- next part --------------
==9907== ERROR SUMMARY: 23 errors from 8 contexts (suppressed: 0 from 0)
==9907== malloc/free: in use at exit: 2,631 bytes in 46 blocks.
==9907== malloc/free: 3,680 allocs, 3,634 frees, 80,420 bytes allocated.
==9907== For counts of detected errors, rerun with: -v
==9907== searching for pointers to 46 not-freed blocks.
==9907== checked 139,452 bytes.
==9907== 
==9907== 
==9907== 16 bytes in 8 blocks are indirectly lost in loss record 1 of 4
==9907==    at 0x43D2367: malloc (vg_replace_malloc.c:149)
==9907==    by 0x43FD958: _gcry_private_malloc (stdmem.c:78)
==9907==    by 0x43FABB2: _gcry_malloc (global.c:421)
==9907==    by 0x43FAC28: gcry_malloc (global.c:441)
==9907==    by 0x4404D6F: gcry_ac_data_extract (ac.c:301)
==9907==    by 0x4405E4B: gcry_ac_key_pair_generate (ac.c:979)
==9907==    by 0x80488AB: main (in /home/pltl/mtm2006/project/demo/rsa-test)
==9907== 
==9907== 
==9907== 65 bytes in 1 blocks are definitely lost in loss record 2 of 4
==9907==    at 0x43D2462: realloc (vg_replace_malloc.c:306)
==9907==    by 0x43FDBEF: _gcry_private_realloc (stdmem.c:146)
==9907==    by 0x43FAD29: gcry_realloc (global.c:486)
==9907==    by 0x43FAFA9: gcry_xrealloc (global.c:591)
==9907==    by 0x43FC093: make_space (sexp.c:794)
==9907==    by 0x43FCBD3: sexp_sscan (sexp.c:1187)
==9907==    by 0x43FD176: gcry_sexp_build_array (sexp.c:1399)
==9907==    by 0x4405D8F: gcry_ac_key_pair_generate (gcrypt.h:121)
==9907==    by 0x80488AB: main (in /home/pltl/mtm2006/project/demo/rsa-test)
==9907== 
==9907== 
==9907== 542 (526 direct, 16 indirect) bytes in 6 blocks are definitely lost in loss record 3 of 4
==9907==    at 0x43D2367: malloc (vg_replace_malloc.c:149)
==9907==    by 0x43FD958: _gcry_private_malloc (stdmem.c:78)
==9907==    by 0x43FABB2: _gcry_malloc (global.c:421)
==9907==    by 0x43FAC28: gcry_malloc (global.c:441)
==9907==    by 0x4405BC8: gcry_ac_key_pair_generate (ac.c:896)
==9907==    by 0x80488AB: main (in /home/pltl/mtm2006/project/demo/rsa-test)
==9907== 
==9907== 
==9907== 2,024 bytes in 31 blocks are still reachable in loss record 4 of 4
==9907==    at 0x43D2367: malloc (vg_replace_malloc.c:149)
==9907==    by 0x43FD958: _gcry_private_malloc (stdmem.c:78)
==9907==    by 0x43FABB2: _gcry_malloc (global.c:421)
==9907==    by 0x43FAC28: gcry_malloc (global.c:441)
==9907==    by 0x43FE666: _gcry_module_add (module.c:77)
==9907==    by 0x43FF037: gcry_cipher_register_default (cipher.c:181)
==9907==    by 0x4400A74: _gcry_cipher_init (cipher.c:1376)
==9907==    by 0x43FA5ED: global_init (global.c:70)
==9907==    by 0x43FA6F2: gcry_check_version (global.c:133)
==9907==    by 0x804884E: main (in /home/pltl/mtm2006/project/demo/rsa-test)
==9907== 
==9907== LEAK SUMMARY:
==9907==    definitely lost: 591 bytes in 7 blocks.
==9907==    indirectly lost: 16 bytes in 8 blocks.
==9907==      possibly lost: 0 bytes in 0 blocks.
==9907==    still reachable: 2,024 bytes in 31 blocks.
==9907==         suppressed: 0 bytes in 0 blocks.


More information about the Gcrypt-devel mailing list