From 32a7848e1b6475f48d2f4a84024ec2699991ca97 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Tue, 21 Jan 2025 14:42:28 +0100 Subject: [PATCH] eddsa_signverify_init(): Avoid memory leak on error Add missing WPACKET_cleanup() call. Fixes Coverity 1638693 Reviewed-by: Neil Horman Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/26500) (cherry picked from commit abbc4073145cb6b2ea221f3e34809e9aefece9ab) --- providers/implementations/signature/eddsa_sig.c | 1 + 1 file changed, 1 insertion(+) diff --git a/providers/implementations/signature/eddsa_sig.c b/providers/implementations/signature/eddsa_sig.c index e6689911c84..cb214f69d28 100644 --- a/providers/implementations/signature/eddsa_sig.c +++ b/providers/implementations/signature/eddsa_sig.c @@ -277,6 +277,7 @@ static int eddsa_signverify_init(void *vpeddsactx, void *vedkey) ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR); ossl_ecx_key_free(edkey); peddsactx->key = NULL; + WPACKET_cleanup(&pkt); return 0; } if (ret && WPACKET_finish(&pkt)) { -- 2.47.2