From 40efa67248c975d4802307e6faeb50e91e320139 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 30 Oct 2002 09:42:42 +0000 Subject: [PATCH] Plug potential memory leak. Identified by Goetz Babin-Ebell --- crypto/pem/pem_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.25.1