From 97d49cdd6f91a511ccfe90715013b64cd177ec29 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bodo=20M=C3=B6ller?= Date: Fri, 11 Mar 2005 09:00:59 +0000 Subject: [PATCH] fix potential memory leak when allocation fails PR: 801 Submitted by: Nils Larsch --- crypto/pem/pem_lib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c index 529329f9f9..82815067b3 100644 --- a/crypto/pem/pem_lib.c +++ b/crypto/pem/pem_lib.c @@ -625,6 +625,9 @@ int PEM_read_bio(BIO *bp, char **name, char **header, unsigned char **data, dataB=BUF_MEM_new(); if ((nameB == NULL) || (headerB == NULL) || (dataB == NULL)) { + BUF_MEM_free(nameB); + BUF_MEM_free(headerB); + BUF_MEM_free(dataB); PEMerr(PEM_F_PEM_READ_BIO,ERR_R_MALLOC_FAILURE); return(0); } -- 2.25.1