]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
eddsa_signverify_init(): Avoid memory leak on error
authorTomas Mraz <tomas@openssl.org>
Tue, 21 Jan 2025 13:42:28 +0000 (14:42 +0100)
committerTomas Mraz <tomas@openssl.org>
Thu, 23 Jan 2025 11:12:20 +0000 (12:12 +0100)
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 abbc4073145cb6b2ea221f3e34809e9aefece9ab)

providers/implementations/signature/eddsa_sig.c

index 3c9b306ea61fc6f78566c9bc7119bf8213e2102c..76f67c18c21b0dd8ef61372b89749f280025ba91 100644 (file)
@@ -132,6 +132,7 @@ static int eddsa_digest_signverify_init(void *vpeddsactx, const char *mdname,
         /* Should never happen */
         ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR);
         ossl_ecx_key_free(edkey);
+        WPACKET_cleanup(&pkt);
         return 0;
     }
     if (ret && WPACKET_finish(&pkt)) {