From b70cebc44fc231361160a4f59f7801e748e78ab0 Mon Sep 17 00:00:00 2001 From: inoguchi Date: Sun, 16 Jan 2022 07:12:28 +0000 Subject: [PATCH] Avoid memory leak in error path with openssl(1) smime CID 345316 ok tb@ --- usr.bin/openssl/smime.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.20.1