On Fri, Jun 24, 2011, Yan, Bob wrote:
Hi,
I have used IBM purify to check my test program which invokes openssl
library. There are some memory leaks reported by Purify, please see
below. Could somebody point to me from which function those leaks were
generated, and how to avoid those leaks? Thanks, Bob
MLK: 1104 bytes leaked in 46 blocks
This memory was allocated from:
malloc [rtlib.o]
CRYPTO_malloc [libcrypto.so.1.0.0]
ASN1_STRING_type_new [libcrypto.so.1.0.0]
ASN1_primitive_new [libcrypto.so.1.0.0]
asn1_item_ex_combine_new [libcrypto.so.1.0.0]
asn1_item_ex_combine_new [libcrypto.so.1.0.0]
ASN1_item_ex_d2i [libcrypto.so.1.0.0]
asn1_template_noexp_d2i [libcrypto.so.1.0.0]
Block of 24 bytes (46 times); last block at 0x2aaaac0f7218
I've used valgrind with OpenSSL based programs to find memory leaks,
and with it, you can use a "--num-callers=N" option to get deeper stack
traces in the leak reports. You need a depth of 15-20 to get far enough
to see where your code is calling into the OpenSSL code in most cases.
There's probably a similar option for IBM purify.
-chris
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager majord...@openssl.org