Release pkey_ctx on initialization failure
authorirosay <59870261+irosay@users.noreply.github.com>
Fri, 10 May 2024 16:37:52 +0000 (17:37 +0100)
committerTomas Mraz <tomas@openssl.org>
Tue, 14 May 2024 15:58:34 +0000 (17:58 +0200)
CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24366)

ssl/statem/statem_srvr.c

index 1c38548fe047dbc59dc1c083a9b49aae1e88bb41..5ff479a2ec1ad07ea9a4664628afdc689bbd8687 100644 (file)
@@ -3230,7 +3230,7 @@ static int tls_process_cke_gost(SSL_CONNECTION *s, PACKET *pkt)
     }
     if (EVP_PKEY_decrypt_init(pkey_ctx) <= 0) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
-        return 0;
+        goto err;
     }
     /*
      * If client certificate is present and is of the same type, maybe