eddsa_signverify_init(): Avoid memory leak on error

Add missing WPACKET_cleanup() call.
Fixes Coverity 1638693

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/26500)

(cherry picked from commit abbc407314)
This commit is contained in:
Tomas Mraz 2025-01-21 14:42:28 +01:00
parent 2e949bf946
commit 32a7848e1b

View file

@ -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)) {