From f0cfc4d90787d42987b072498672b0ddbf813870 Mon Sep 17 00:00:00 2001 From: tb <> Date: Sat, 7 Jun 2025 09:32:35 +0000 Subject: do_PVK_body: Unconditionally free enctmp enctmp is only allocated if saltlen > 0, so there is no harm in checking for that, but it's also pointless. Unconfuses smatch who thinks there might be a memory leak: pem/pvkfmt.c:808 do_PVK_body() warn: possible memory leak of 'enctmp' found by jsg --- src/lib/libcrypto/pem/pvkfmt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/lib/libcrypto/pem/pvkfmt.c b/src/lib/libcrypto/pem/pvkfmt.c index 6967d65eee..395fd9df83 100644 --- a/src/lib/libcrypto/pem/pvkfmt.c +++ b/src/lib/libcrypto/pem/pvkfmt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pvkfmt.c,v 1.29 2025/05/10 05:54:38 tb Exp $ */ +/* $OpenBSD: pvkfmt.c,v 1.30 2025/06/07 09:32:35 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2005. */ @@ -803,8 +803,8 @@ do_PVK_body(const unsigned char **in, unsigned int saltlen, err: EVP_CIPHER_CTX_free(cctx); - if (enctmp && saltlen) - free(enctmp); + free(enctmp); + return ret; } -- cgit v1.2.3-55-g6feb