coverity 1462574 Resource leak
authorPauli <paul.dale@oracle.com>
Sun, 26 Apr 2020 23:19:11 +0000 (09:19 +1000)
committerPauli <paul.dale@oracle.com>
Thu, 30 Apr 2020 10:21:33 +0000 (20:21 +1000)
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11651)

providers/implementations/keymgmt/rsa_kmgmt.c

index 3bf175b..181df99 100644 (file)
@@ -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;