]> 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:49:57 +0000 (08:49 -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 6ea0001e5787f73382668af83cbb27e636a373b2..941dbfa35d881c90dec7f33e6e6c28178a04cc07 100644 (file)
@@ -510,8 +510,10 @@ static void *ecx_gen_init(void *provctx, int selection,
 #endif
     }
     if (!ecx_gen_set_params(gctx, params)) {
-        ecx_gen_cleanup(gctx);
-        gctx = NULL;
+        if (gctx != NULL) {
+            ecx_gen_cleanup(gctx);
+            gctx = NULL;
+        }
     }
     return gctx;
 }