coverity 1462574 Resource leak
[openssl.git] / providers / implementations / keymgmt / rsa_kmgmt.c
index 8ea394115b43990f1133a28fa106c8cd1ac5506b..181df998ad627af90d16bdbf499ce47b7a11e2a2 100644 (file)
@@ -176,7 +176,7 @@ err:
     return ok;
 }
 
-#ifdef FIPS_MODE
+#ifdef FIPS_MODULE
 /* In fips mode there are no multi-primes. */
 # define RSA_KEY_MP_TYPES()                                                    \
 OSSL_PARAM_BN(OSSL_PKEY_PARAM_RSA_FACTOR1, NULL, 0),                           \
@@ -376,6 +376,7 @@ static void *rsa_gen_init(void *provctx, int selection)
         if ((gctx->pub_exp = BN_new()) == NULL
             || !BN_set_word(gctx->pub_exp, RSA_F4)) {
             BN_free(gctx->pub_exp);
+            OPENSSL_free(gctx);
             gctx = NULL;
         } else {
             gctx->nbits = 2048;