From: xkernel Date: Tue, 4 Jan 2022 13:18:02 +0000 (+0800) Subject: properly free the resource from CRYPTO_malloc X-Git-Tag: openssl-3.2.0-alpha1~3128 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b87116a0c43b8b4e1ad88b851d5bcf27c1a5f64;p=thirdparty%2Fopenssl.git properly free the resource from CRYPTO_malloc Reviewed-by: Kurt Roeckx Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/17412) --- diff --git a/ssl/statem/statem_clnt.c b/ssl/statem/statem_clnt.c index 10e778d681b..3e94d9e1851 100644 --- a/ssl/statem/statem_clnt.c +++ b/ssl/statem/statem_clnt.c @@ -3187,7 +3187,7 @@ static int tls_construct_cke_gost18(SSL *s, WPACKET *pkt) if (peer_cert == NULL) { SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE, SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER); - return 0; + goto err; } pkey_ctx = EVP_PKEY_CTX_new_from_pkey(s->ctx->libctx, @@ -3195,7 +3195,7 @@ static int tls_construct_cke_gost18(SSL *s, WPACKET *pkt) s->ctx->propq); if (pkey_ctx == NULL) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_MALLOC_FAILURE); - return 0; + goto err; } if (EVP_PKEY_encrypt_init(pkey_ctx) <= 0) {