diff --git a/providers/implementations/keymgmt/dsa_kmgmt.c b/providers/implementations/keymgmt/dsa_kmgmt.c index 3b12be27cc..0b41e0a173 100644 --- a/providers/implementations/keymgmt/dsa_kmgmt.c +++ b/providers/implementations/keymgmt/dsa_kmgmt.c @@ -430,7 +430,7 @@ static void *dsa_gen_init(void *provctx, int selection, OSSL_FIPS_IND_INIT(gctx) } if (!dsa_gen_set_params(gctx, params)) { - OPENSSL_free(gctx); + dsa_gen_cleanup(gctx); gctx = NULL; } return gctx;