From 8c040c086ca11a519975c58961a5dc933aa6524a Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Mon, 11 Sep 2023 06:38:31 +0200 Subject: 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 Reviewed-by: Nicola Tuveri (Merged from https://github.com/openssl/openssl/pull/22055) --- apps/dhparam.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'apps/dhparam.c') 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) { -- cgit v1.2.3