]> 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:33:31 +0000 (08:33 -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)

providers/implementations/keymgmt/ecx_kmgmt.c

index 294b8839aa32f4c6c8ca366f170b55e2c05148b1..dfa2e00621209814e7fb3f90335b1818cbf581fe 100644 (file)
@@ -515,8 +515,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;
 }