memory leak in initialize_registered

Nikos Mavrogiannopoulos nmav at gnutls.org
Mon Feb 20 14:23:52 PST 2012


I've noticed a 512-byte leak on initialize_registered. I haven't figured
out the place, but it is easily reproducible wit valgrind and the
included p11-kit program.

$ valgrind --leak-check=full --show-reachable=yes ./p11-kit -l
==18687== Memcheck, a memory error detector
==18687== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==18687== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info
==18687== Command: ./p11-kit -l
==18687==
==18687==
==18687== HEAP SUMMARY:
==18687==     in use at exit: 512 bytes in 1 blocks
==18687==   total heap usage: 11 allocs, 10 frees, 1,474 bytes allocated
==18687==
==18687== 512 bytes in 1 blocks are still reachable in loss record 1 of 1
==18687==    at 0x4C25E84: calloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==18687==    by 0x4E300FE: _p11_library_get_thread_local (util.c:262)
==18687==    by 0x4E302D8: _p11_kit_clear_message (util.c:233)
==18687==    by 0x4E32B66: p11_kit_initialize_registered (modules.c:722)
==18687==    by 0x40130A: list_modules (p11-kit.c:217)
==18687==    by 0x547DEAC: (below main) (libc-start.c:228)
==18687==
==18687== LEAK SUMMARY:
==18687==    definitely lost: 0 bytes in 0 blocks
==18687==    indirectly lost: 0 bytes in 0 blocks
==18687==      possibly lost: 0 bytes in 0 blocks
==18687==    still reachable: 512 bytes in 1 blocks
==18687==         suppressed: 0 bytes in 0 blocks


More information about the p11-glue mailing list