From 0eae6cd5f20525def0bb5eb894a896a427c0e573 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 30 Oct 2002 09:42:47 +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 a8db6ffbf5..296865a4dc 100644 --- a/crypto/pem/pem_lib.c +++ b/crypto/pem/pem_lib.c @@ -249,7 +249,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