summaryrefslogtreecommitdiffstats
path: root/apps/lib
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2023-09-11 06:38:31 +0200
committerBernd Edlinger <bernd.edlinger@hotmail.de>2023-09-21 14:39:36 +0200
commit8c040c086ca11a519975c58961a5dc933aa6524a (patch)
tree3ba0ef6ed64669b4dc82a50ba3e6905913f3cb7d /apps/lib
parent080bd08fd32608b4f2edfa4b1e87e199b08a8835 (diff)
Fix some memory leaks in the openssl app
In some error cases the normal cleanup did not happen, but instead an exit(1) which caused some memory leaks, as reported in #22049. Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/22055)
Diffstat (limited to 'apps/lib')
-rw-r--r--apps/lib/apps.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/lib/apps.c b/apps/lib/apps.c
index 8aad9a1ef7..6b2a4b86ce 100644
--- a/apps/lib/apps.c
+++ b/apps/lib/apps.c
@@ -3417,8 +3417,8 @@ EVP_PKEY *app_keygen(EVP_PKEY_CTX *ctx, const char *alg, int bits, int verbose)
BIO_printf(bio_err, "Warning: generating random key material may take a long time\n"
"if the system has a poor entropy source\n");
if (EVP_PKEY_keygen(ctx, &res) <= 0)
- app_bail_out("%s: Error generating %s key\n", opt_getprog(),
- alg != NULL ? alg : "asymmetric");
+ BIO_printf(bio_err, "%s: Error generating %s key\n", opt_getprog(),
+ alg != NULL ? alg : "asymmetric");
return res;
}
@@ -3430,8 +3430,8 @@ EVP_PKEY *app_paramgen(EVP_PKEY_CTX *ctx, const char *alg)
BIO_printf(bio_err, "Warning: generating random key parameters may take a long time\n"
"if the system has a poor entropy source\n");
if (EVP_PKEY_paramgen(ctx, &res) <= 0)
- app_bail_out("%s: Generating %s key parameters failed\n",
- opt_getprog(), alg != NULL ? alg : "asymmetric");
+ BIO_printf(bio_err, "%s: Generating %s key parameters failed\n",
+ opt_getprog(), alg != NULL ? alg : "asymmetric");
return res;
}