From: Bodo Möller Date: Fri, 11 Mar 2005 09:00:18 +0000 (+0000) Subject: fix potential memory leak when allocation fails X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c4fddde87b60ab6393c1a57dfa51dd1dff2f7902;p=oweals%2Fopenssl.git fix potential memory leak when allocation fails PR: 801 Submitted by: Nils Larsch --- diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c index 1119c2f4d2..4daf5b0b10 100644 --- a/crypto/pem/pem_lib.c +++ b/crypto/pem/pem_lib.c @@ -655,6 +655,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); }