diff options
| author | tb <> | 2025-06-07 09:32:35 +0000 |
|---|---|---|
| committer | tb <> | 2025-06-07 09:32:35 +0000 |
| commit | 852ff96f12cab66a43fa3f58d19246c7a21c875e (patch) | |
| tree | ae8fd8c675d0fdad1149e33aeb0f8648d63eeeec /src | |
| parent | c7d111899342662acc283c79460c528fac240a59 (diff) | |
| download | openbsd-852ff96f12cab66a43fa3f58d19246c7a21c875e.tar.gz openbsd-852ff96f12cab66a43fa3f58d19246c7a21c875e.tar.bz2 openbsd-852ff96f12cab66a43fa3f58d19246c7a21c875e.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.c | 6 |
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 | ||
