From: Richard Levitte Date: Wed, 30 Oct 2002 09:42:42 +0000 (+0000) Subject: Plug potential memory leak. X-Git-Tag: OpenSSL_0_9_7-beta4~18^2~95 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=40efa67248c975d4802307e6faeb50e91e320139;p=openssl Plug potential memory leak. Identified by Goetz Babin-Ebell --- diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c index 7066e67b39..bfc43e90af 100644 --- a/crypto/pem/pem_lib.c +++ b/crypto/pem/pem_lib.c @@ -251,7 +251,7 @@ int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, const char ret = 1; err: - if (!pnm) OPENSSL_free(nm); + if (!ret || !pnm) OPENSSL_free(nm); OPENSSL_free(header); if (!ret) OPENSSL_free(data); return ret;