summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2024-11-30 10:01:31 +0000
committertb <>2024-11-30 10:01:31 +0000
commitb904925934b9c033c83089cd3b396ae763a5ea3f (patch)
treedf589091bf72fb5fa0e66054f910e6757e508948
parent0c4bef0c67554c96db6dc257452593c5a9b573ec (diff)
downloadopenbsd-b904925934b9c033c83089cd3b396ae763a5ea3f.tar.gz
openbsd-b904925934b9c033c83089cd3b396ae763a5ea3f.tar.bz2
openbsd-b904925934b9c033c83089cd3b396ae763a5ea3f.zip
Don't leak the abuf on error in PKCS7_dataFinal()
ok beck miod
-rw-r--r--src/lib/libcrypto/pkcs7/pk7_doit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/libcrypto/pkcs7/pk7_doit.c b/src/lib/libcrypto/pkcs7/pk7_doit.c
index 3cc7add66f..e1c075f15a 100644
--- a/src/lib/libcrypto/pkcs7/pk7_doit.c
+++ b/src/lib/libcrypto/pkcs7/pk7_doit.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pk7_doit.c,v 1.56 2024/02/18 15:45:42 tb Exp $ */ 1/* $OpenBSD: pk7_doit.c,v 1.57 2024/11/30 10:01:31 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -813,6 +813,7 @@ PKCS7_dataFinal(PKCS7 *p7, BIO *bio)
813 if (!EVP_SignFinal(&ctx_tmp, abuf, &abuflen, 813 if (!EVP_SignFinal(&ctx_tmp, abuf, &abuflen,
814 si->pkey)) { 814 si->pkey)) {
815 PKCS7error(ERR_R_EVP_LIB); 815 PKCS7error(ERR_R_EVP_LIB);
816 free(abuf);
816 goto err; 817 goto err;
817 } 818 }
818 ASN1_STRING_set0(si->enc_digest, abuf, abuflen); 819 ASN1_STRING_set0(si->enc_digest, abuf, abuflen);