summaryrefslogtreecommitdiffstats
path: root/apps/dhparam.c
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/dhparam.c
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/dhparam.c')
-rw-r--r--apps/dhparam.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/dhparam.c b/apps/dhparam.c
index a41e70fe38..d14c569503 100644
--- a/apps/dhparam.c
+++ b/apps/dhparam.c
@@ -233,6 +233,8 @@ int dhparam_main(int argc, char **argv)
}
tmppkey = app_paramgen(ctx, alg);
+ if (tmppkey == NULL)
+ goto end;
EVP_PKEY_CTX_free(ctx);
ctx = NULL;
if (dsaparam) {