]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
check gctx for NULL before cleanup.
authorBartel Artem <artem.bartel@gmail.com>
Tue, 10 Jun 2025 10:11:41 +0000 (13:11 +0300)
committerNeil Horman <nhorman@openssl.org>
Thu, 12 Jun 2025 12:59:10 +0000 (08:59 -0400)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27795)

(cherry picked from commit 02f9c9342d54c99981b0a83088982bf0d1083d7f)

providers/implementations/keymgmt/ecx_kmgmt.c

index 51bdaba4a059cc9818f9cc2dd89079b3302a823f..45871fd5778c192ef50a8553ec58ef0c1763a8fc 100644 (file)
@@ -487,8 +487,10 @@ static void *ecx_gen_init(void *provctx, int selection,
         gctx->selection = selection;
     }
     if (!ecx_gen_set_params(gctx, params)) {
-        ecx_gen_cleanup(gctx);
-        gctx = NULL;
+        if (gctx != NULL) {
+            ecx_gen_cleanup(gctx);
+            gctx = NULL;
+        }
     }
     return gctx;
 }