Bodo Moeller wrote:
>
> [EMAIL PROTECTED]:
>
> > VC6.0 detected memory leaks in the following code! And the code do only
>PEM_read_bio_PrivateKey()!!
> >
> > When I enabled the OpenSSL_add_ssl_algorithms() and the PEM_read_bio_PrivateKey
> > () finished sucessful, there is no memory leaks.
> > But when I disable(comment out) the Openssl_add_ssl_algorithms() and the
> > PEM_read_bio_PrivateKey() failed, the following code caused memory leaks.
> [...]
> > Anyone have an idea?
>
> Did you try OpenSSL's memory leak checking? (See, for example, ssltest.c
> for how to use it; a list of leaks found by OpenSSL will be output to a BIO.)
>
> You should free your OpenSSL objects (pKey, in) *before* freeing
> the library-internal stuff (EVP_cleanup() etc.), I don't know
> if it makes a difference in this specific case though.
This may be a leak caused by OpenSSL not freeing up the error table in
crypto/err.c in variable thread_hash.
This isn't a serious problem in practice and only a small amount of
memory will be allocated to thread_hash.
This is only noticeable if some errors have been added to the error
table.
I suppose we should have a function that frees up all threads error
tables and zeroes thread_hash.
Steve.
--
Dr Stephen N. Henson. http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED]
Senior crypto engineer, Celo Communications: http://www.celocom.com/
Core developer of the OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]