valgrind openssl destroy as far as possible 70/3070/1
authorAndy Green <andy.green@linaro.org>
Mon, 11 Feb 2013 06:50:45 +0000 (14:50 +0800)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 7 Mar 2013 21:01:34 +0000 (13:01 -0800)
commit31da481ea37dae1c72c9c5abdacb222deedff509
tree54c2c72cb78d1e32ef9824e8c1a22aa78d8f5683
parent77bc126f769751860bbcd742936f737ad8410575
valgrind openssl destroy as far as possible

OpenSSL doesn't seem to have a way to close out three allocations
it creates during SSL library init.

Even after doing the magic incantations suggested on the openssl list, we're
left with these.  Well, 88 bytes from ssl init is probably not critical,
but it's annoying

==15206== HEAP SUMMARY:
==15206==     in use at exit: 88 bytes in 3 blocks
==15206==   total heap usage: 13,566 allocs, 13,563 frees, 5,933,134 bytes allocated
==15206==
==15206== 24 bytes in 1 blocks are still reachable in loss record 1 of 3
==15206==    at 0x4A06409: malloc (vg_replace_malloc.c:270)
==15206==    by 0x3014C612B2: CRYPTO_malloc (in /usr/lib64/libcrypto.so.1.0.1c)
==15206==    by 0x3015441B38: ??? (in /usr/lib64/libssl.so.1.0.1c)
==15206==    by 0x3015443A78: SSL_COMP_get_compression_methods (in /usr/lib64/libssl.so.1.0.1c)
==15206==    by 0x301544932B: SSL_library_init (in /usr/lib64/libssl.so.1.0.1c)
==15206==    by 0x4C340D4: libwebsocket_create_context (libwebsockets.c:1796)
==15206==    by 0x401C08: main (in /usr/bin/libwebsockets-test-server)
==15206==
==15206== 32 bytes in 1 blocks are still reachable in loss record 2 of 3
==15206==    at 0x4A06409: malloc (vg_replace_malloc.c:270)
==15206==    by 0x3014C612B2: CRYPTO_malloc (in /usr/lib64/libcrypto.so.1.0.1c)
==15206==    by 0x3014CC91BE: sk_new (in /usr/lib64/libcrypto.so.1.0.1c)
==15206==    by 0x3015441AF9: ??? (in /usr/lib64/libssl.so.1.0.1c)
==15206==    by 0x3015443A78: SSL_COMP_get_compression_methods (in /usr/lib64/libssl.so.1.0.1c)
==15206==    by 0x301544932B: SSL_library_init (in /usr/lib64/libssl.so.1.0.1c)
==15206==    by 0x4C340D4: libwebsocket_create_context (libwebsockets.c:1796)
==15206==    by 0x401C08: main (in /usr/bin/libwebsockets-test-server)
==15206==
==15206== 32 bytes in 1 blocks are still reachable in loss record 3 of 3
==15206==    at 0x4A06409: malloc (vg_replace_malloc.c:270)
==15206==    by 0x3014C612B2: CRYPTO_malloc (in /usr/lib64/libcrypto.so.1.0.1c)
==15206==    by 0x3014CC91DC: sk_new (in /usr/lib64/libcrypto.so.1.0.1c)
==15206==    by 0x3015441AF9: ??? (in /usr/lib64/libssl.so.1.0.1c)
==15206==    by 0x3015443A78: SSL_COMP_get_compression_methods (in /usr/lib64/libssl.so.1.0.1c)
==15206==    by 0x301544932B: SSL_library_init (in /usr/lib64/libssl.so.1.0.1c)
==15206==    by 0x4C340D4: libwebsocket_create_context (libwebsockets.c:1796)
==15206==    by 0x401C08: main (in /usr/bin/libwebsockets-test-server)
==15206==
==15206== LEAK SUMMARY:
==15206==    definitely lost: 0 bytes in 0 blocks
==15206==    indirectly lost: 0 bytes in 0 blocks
==15206==      possibly lost: 0 bytes in 0 blocks
==15206==    still reachable: 88 bytes in 3 blocks
==15206==         suppressed: 0 bytes in 0 blocks

Signed-off-by: Andy Green <andy.green@linaro.org>
lib/libwebsockets.c