GH634: fix potential memory leak
authorInsu Yun <wuninsu@gmail.com>
Fri, 5 Feb 2016 22:37:49 +0000 (17:37 -0500)
committerRich Salz <rsalz@openssl.org>
Sat, 6 Feb 2016 14:25:54 +0000 (09:25 -0500)
Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
apps/req.c

index eddbc77839d68088a2c61ddc2b44a31d621069ae..d6d46a95ff8b65648f3e1d79f1ae19e21846ed54 100644 (file)
@@ -1451,6 +1451,7 @@ static EVP_PKEY_CTX *set_keygen_ctx(const char *gstr,
     if (EVP_PKEY_keygen_init(gctx) <= 0) {
         BIO_puts(bio_err, "Error initializing keygen context\n");
         ERR_print_errors(bio_err);
+        EVP_PKEY_CTX_free(gctx);
         return NULL;
     }
 #ifndef OPENSSL_NO_RSA