cURL / Mailing Lists / curl-users / Single Mail

curl-users

[ curl-Bugs-650989 ] Memory leak when retrieving public key

From: <noreply_at_sourceforge.net>
Date: Mon, 09 Dec 2002 09:39:18 -0800

Bugs item #650989, was opened at 2002-12-09 09:39
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=650989&group_id=976

Category: https
Group: bad behaviour
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Daniel Stenberg (bagder)
Summary: Memory leak when retrieving public key

Initial Comment:
curl version: 7.10.2
OS: all
file:ssluse.c line 329
There is a memory leak when passing the return value of
X509_get_pubkey directly into
EVP_PKEY_copy_parameters. The EVP_PKEY must
be freed after it is used by
EVP_PKEY_copy_parameters

current code:

if (x509 != NULL)
   EVP_PKEY_copy_parameters(X509_get_pubkey
(x509), SSL_get_privatekey(ssl));

suggested fix:

    if (x509 != NULL)
    {
        EVP_PKEY *pktmp;
        pktmp = X509_get_pubkey(x509);
        EVP_PKEY_copy_parameters
(pktmp,SSL_get_privatekey(ssl));
        EVP_PKEY_free(pktmp);
    }

submitter: Evan Jordan
email: evanjordan_at_hotmail.com

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=650989&group_id=976

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2002-12-09