From c68a58575b6d0520e342cb3d3796a8fecd66405d Mon Sep 17 00:00:00 2001
From: Norbert Pocs <npocs@redhat.com>
Date: Mon, 24 Apr 2023 11:55:59 +0200
Subject: [PATCH] CVE-2023-2283:pki_crypto: Remove unnecessary NULL check

Signed-off-by: Norbert Pocs <npocs@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>

Conflict:NA
Reference:https://gitlab.com/libssh/libssh-mirror/commit/c68a58575b6d0520e342cb3d3796a8fecd66405d
---
 src/pki_crypto.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/pki_crypto.c b/src/pki_crypto.c
index aaa85ba..9f80086 100644
--- a/src/pki_crypto.c
+++ b/src/pki_crypto.c
@@ -2387,9 +2387,7 @@ int pki_verify_data_signature(ssh_signature signature,
     rc = SSH_OK;
 
 out:
-    if (ctx != NULL) {
-        EVP_MD_CTX_free(ctx);
-    }
+    EVP_MD_CTX_free(ctx);
     if (pkey != NULL) {
         EVP_PKEY_free(pkey);
     }
-- 
2.33.0

