Apparently it's in SSLeay_add_all_algorithms();
I found it by removing code portions successively.
If you make a win32 console app that calls the 2 functions below in
sequence, and compile it in the debug version, you'll see it. Move the call
to SSLeay_add_all_algorithms out of the #if 0 portion, and you'll see the
leaks.

int OpenSSLStart()
{
#ifdef CRYPTO_MDEBUG
    _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);    /* win32 specific */
#endif

    /* init error BIO */
 pBioErr = BIO_new_fp(stderr,BIO_NOCLOSE);
    if (pBioErr == NULL)
        return(1);

    /* init OpenSSL debug tools */
//#ifdef CRYPTO_MDEBUG
#if 0
    CRYPTO_malloc_debug_init();
    CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
#else
    CRYPTO_malloc_init();
#endif

    /* load error strings & all crypto algorithms */
#if 0
    ERR_load_crypto_strings();
    SSLeay_add_all_algorithms();
#endif

    return(0);
}

void OpenSSLStop()
{
    EVP_cleanup();
    ERR_remove_state(0);
    ERR_free_strings();

    /* print mem leaks */
//#ifdef CRYPTO_MDEBUG
#if 0
    CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF);
    CRYPTO_mem_leaks(pBioErr);
#endif

    BIO_free(pBioErr);

#ifdef CRYPTO_MDEBUG
    _CrtDumpMemoryLeaks( );     /* win32 specific */
#endif
}

----- Original Message -----
From: Bodo Moeller <[EMAIL PROTECTED]>
To: Richard Dykiel <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, March 16, 2000 5:18 PM
Subject: Re: memory leaks in SSLeay_add_all_algorithms?


> On Thu, Mar 16, 2000 at 05:31:50PM -0500, Richard Dykiel wrote:
>
> > Tried it, now I have less leaks:
> > Detected memory leaks!
> > Dumping objects ->
> > {3409} normal block at 0x0090A8D0, 512 bytes long.
> >  Data: <                > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00
> > {2596} normal block at 0x008FC880, 96 bytes long.
> >  Data: <    l @   @ A   > D0 A8 90 00 6C B5 40 00 EF B5 40 00 41 00 00
00
> > Object dump complete.
>
> Hm, I wonder what these are.  Could you try to find out when these
> leaks occur?  (I.e. if you emit all OpenSSL calls except those for
> printing memory leaks, are they still there?  If so, what if
> you don't invoke OpenSSL at all?)
>

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to