summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2025-06-07 09:32:35 +0000
committertb <>2025-06-07 09:32:35 +0000
commitf0cfc4d90787d42987b072498672b0ddbf813870 (patch)
treeae8fd8c675d0fdad1149e33aeb0f8648d63eeeec /src
parent94ff2e0482fb8e9f39c5cd1da0b79ead60a25ee4 (diff)
downloadopenbsd-f0cfc4d90787d42987b072498672b0ddbf813870.tar.gz
openbsd-f0cfc4d90787d42987b072498672b0ddbf813870.tar.bz2
openbsd-f0cfc4d90787d42987b072498672b0ddbf813870.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/pem/pvkfmt.c6
1 files changed, 3 insertions, 3 deletions
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 @@
1/* $OpenBSD: pvkfmt.c,v 1.29 2025/05/10 05:54:38 tb Exp $ */ 1/* $OpenBSD: pvkfmt.c,v 1.30 2025/06/07 09:32:35 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2005. 3 * project 2005.
4 */ 4 */
@@ -803,8 +803,8 @@ do_PVK_body(const unsigned char **in, unsigned int saltlen,
803 803
804 err: 804 err:
805 EVP_CIPHER_CTX_free(cctx); 805 EVP_CIPHER_CTX_free(cctx);
806 if (enctmp && saltlen) 806 free(enctmp);
807 free(enctmp); 807
808 return ret; 808 return ret;
809} 809}
810 810