Good eye but that's not it. The code below should read BN_free(Res). Thanks.

On May 2, 2013, at 10:42 PM, Jeremy Farrell wrote:

From: Tom marchand [mailto:tpmarch...@gmail.com]
Sent: Friday, May 03, 2013 2:55 AM

I am using the following code to create a temporary BIGNUM  to hold
the result of multiplication:

BIGNUM  *Res;

while(!Done)
{
        Res=BN_new();
        BN_init(Res);

        BN_mul(Res,A,B,Ctx);

        BN_free();

}

This code works with the exception that BN_free() is not releasing the
memory allocated to Res.  I already have a workaround but I am
wondering why the memory isn't being released. In production the code
runs for hours and is causing a significant memory leak.  I am I
misusing BN_new and BN_free? The code is running on OSX 10.5.8,
Openssl 0.9.7l.  I get the same result with OpenSSL 1.0.1e.

BN_free(Res);  ???
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to