summaryrefslogtreecommitdiff
path: root/usr.bin/openssl/smime.c
diff options
context:
space:
mode:
authorKinichiro Inoguchi <inoguchi@cvs.openbsd.org>2022-01-16 07:12:29 +0000
committerKinichiro Inoguchi <inoguchi@cvs.openbsd.org>2022-01-16 07:12:29 +0000
commit9538391365cd58d298a8d24cc1ccfd79fcb91d72 (patch)
tree9417cd4685b601a53b6ef0d7979691e4d8ec7474 /usr.bin/openssl/smime.c
parent5d7da574571bf55bb80528de3ba3b0236504835d (diff)
Avoid memory leak in error path with openssl(1) smime
CID 345316 ok tb@
Diffstat (limited to 'usr.bin/openssl/smime.c')
-rw-r--r--usr.bin/openssl/smime.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/openssl/smime.c b/usr.bin/openssl/smime.c
index 1a82d068651..2503177f0fe 100644
--- a/usr.bin/openssl/smime.c
+++ b/usr.bin/openssl/smime.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smime.c,v 1.16 2022/01/11 16:06:48 inoguchi Exp $ */
+/* $OpenBSD: smime.c,v 1.17 2022/01/16 07:12:28 inoguchi Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project.
*/
@@ -1025,6 +1025,7 @@ smime_main(int argc, char **argv)
if (!save_certs(smime_config.signerfile, signers)) {
BIO_printf(bio_err, "Error writing signers to %s\n",
smime_config.signerfile);
+ sk_X509_free(signers);
ret = 5;
goto end;
}