On Thu, Jan 09, 2003, Aslam wrote:
> Hi,
>
> I used to do openssl memory leaks checking using following code under
> openssl-0.9.6x:
>
> int main(int argc, char* argv[])
> {
> CRYPTO_malloc_debug_init();
> CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL);
> CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
> OpenSSL_add_all_algorithms();
>
> bio_stdout = BIO_new_fp(stdout, BIO_NOCLOSE);
>
> if(bio_stdout)
> BIO_free(bio_stdout);
>
> printf("\n");
>
> OBJ_cleanup();
> EVP_cleanup();
> ERR_clear_error();
> ERR_free_strings();
> ERR_remove_state(0);
>
> CRYPTO_mem_leaks_fp(stderr);
> printf("\n");
>
> return 0;
> }
>
> Above code looks like it worked fine, I mean it detected if I miss any free
> call.
>
> But the same code is giving me following leaks under openssl-0.9.7 and its
> betas:
>
> [12:55:41] 351 file=.\crypto\stack\stack.c, line=124, thread=892,
> number=20, a
> ddress=008D3390
> [12:55:41] 350 file=.\crypto\ex_data.c, line=308, thread=892, number=12,
> addre
> ss=008D3460
> [12:55:41] 348 file=.\crypto\lhash\lhash.c, line=119, thread=892,
> number=96, a
> ddress=008D3630
> [12:55:41] 349 file=.\crypto\lhash\lhash.c, line=121, thread=892,
> number=64, a
> ddress=008D3530
> [12:55:41] 353 file=.\crypto\lhash\lhash.c, line=193, thread=892,
> number=12, a
> ddress=008D31F0
> [12:55:41] 352 file=.\crypto\stack\stack.c, line=126, thread=892,
> number=16, a
> ddress=008D32C0
> 220 bytes leaked in 6 chunks
>
> What I should do to resolve these? Are there any leaks or no leaks ??
>
Probably the new ex_data code. Try adding CRYPTO_cleanup_all_ex_data();
in there.
Steve.
--
Dr. Stephen Henson [EMAIL PROTECTED]
OpenSSL Project http://www.openssl.org/~steve/
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]