From 764ca96c953b4bcc23a390a1f68dbcad81a2b12f Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Thu, 21 May 2015 01:15:51 +0100 Subject: [PATCH] Fix memory leak. Reviewed-by: Rich Salz --- crypto/pkcs12/p12_decr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/pkcs12/p12_decr.c b/crypto/pkcs12/p12_decr.c index f19830cf73..8996b9ed84 100644 --- a/crypto/pkcs12/p12_decr.c +++ b/crypto/pkcs12/p12_decr.c @@ -75,7 +75,7 @@ unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass, int passlen, unsigned char *in, int inlen, unsigned char **data, int *datalen, int en_de) { - unsigned char *out; + unsigned char *out = NULL; int outlen, i; EVP_CIPHER_CTX ctx; @@ -85,7 +85,7 @@ unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass, algor->parameter, &ctx, en_de)) { PKCS12err(PKCS12_F_PKCS12_PBE_CRYPT, PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR); - return NULL; + goto err; } if ((out = OPENSSL_malloc(inlen + EVP_CIPHER_CTX_block_size(&ctx))) -- GitLab