cURL / Mailing Lists / curl-library / Single Mail

curl-library

memory leak?

From: Phil Pellouchoud <Phil_at_slacker.com>
Date: Tue, 19 Aug 2008 16:41:05 -0700

In ssluse.c there exists the following function:

 

/* Global cleanup */

void Curl_ossl_cleanup(void)

{

  /* Free the SSL error strings */

  ERR_free_strings();

 

  /* EVP_cleanup() removes all ciphers and digests from the

     table. */

  EVP_cleanup();

 

#ifdef HAVE_ENGINE_cleanup

  ENGINE_cleanup();

#endif

 

#ifdef HAVE_CRYPTO_CLEANUP_ALL_EX_DATA

  /* this function was not present in 0.9.6b, but was added sometimes

     later */

  CRYPTO_cleanup_all_ex_data();

#endif

}

 

I noticed a memory leak after making an HTTPS call. After some amount
of digging, I found that the last function CRYPTO_cleanup_all_ex_data()
was not getting called (i.e. it was effectively not compiled in). If I
put a call to that after curl_global_cleanup(), I noticed that the
memory leak went away. This lead me to believe that I should have had
HAVE_CRYPTO_CLEANUP_ALL_EX_DATA defined. I searched for that constant
and only found it in config-tpf.h and config-symbian.h (which had it
commented out). I'm guessing that should be defined in config-win32.h,
but I'd like some guidance here; like possibly if I'm doing something
wrong or doing it the wrong way...

 

Thanks.

 

-phil

 

p.s. I am using:

- curl-7.18.2

- openssl-0.9.8h

- zlib-1.2.3
Received on 2008-08-20