diff options
author | Bodo Möller <bodo@openssl.org> | 2005-03-11 09:00:18 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2005-03-11 09:00:18 +0000 |
commit | c4fddde87b60ab6393c1a57dfa51dd1dff2f7902 (patch) | |
tree | 46fe4d2fc184190c70ade5d8e2f0075e7bd9aa5a | |
parent | f59229cca28bb28d9bd646274cceed9a73d743ad (diff) | |
download | openssl-c4fddde87b60ab6393c1a57dfa51dd1dff2f7902.zip openssl-c4fddde87b60ab6393c1a57dfa51dd1dff2f7902.tar.gz openssl-c4fddde87b60ab6393c1a57dfa51dd1dff2f7902.tar.bz2 |
fix potential memory leak when allocation fails
PR: 801
Submitted by: Nils Larsch
-rw-r--r-- | crypto/pem/pem_lib.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c index 1119c2f..4daf5b0 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); } |