summaryrefslogtreecommitdiffstats
path: root/crypto/pkcs7/pk7_doit.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-04-27 14:09:35 +0100
committerMatt Caswell <matt@openssl.org>2016-04-28 13:13:09 +0100
commitd54ac5c4bfcb75967960492de31a83fbc7c46673 (patch)
tree9d493691a17ed66f303decca8c3f989b8c563177 /crypto/pkcs7/pk7_doit.c
parent460c5e1d2f7388216f12d345d13202381b30e2a3 (diff)
Free memory on error in PKCS7_dataFinal()
The PKCS7_dataFinal() function allocates a memory buffer but then fails to free it on an error condition. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/pkcs7/pk7_doit.c')
-rw-r--r--crypto/pkcs7/pk7_doit.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/pkcs7/pk7_doit.c b/crypto/pkcs7/pk7_doit.c
index 9d66fc4007..72bd54d627 100644
--- a/crypto/pkcs7/pk7_doit.c
+++ b/crypto/pkcs7/pk7_doit.c
@@ -808,6 +808,7 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio)
goto err;
if (!EVP_SignFinal(ctx_tmp, abuf, &abuflen, si->pkey)) {
+ OPENSSL_free(abuf);
PKCS7err(PKCS7_F_PKCS7_DATAFINAL, ERR_R_EVP_LIB);
goto err;
}