diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2023-09-11 06:38:31 +0200 |
---|---|---|
committer | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2023-09-21 14:40:28 +0200 |
commit | 7e792574f97d16f2479d0b821552d2059be26694 (patch) | |
tree | 409dd436d90df9185e409a4724514c7ae2e1095a /apps/gendsa.c | |
parent | 266e86617f387a8cbdd0207f5cf9b0b55723ae5a (diff) | |
download | openssl-7e792574f97d16f2479d0b821552d2059be26694.zip openssl-7e792574f97d16f2479d0b821552d2059be26694.tar.gz openssl-7e792574f97d16f2479d0b821552d2059be26694.tar.bz2 |
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)
(cherry picked from commit 8c040c086ca11a519975c58961a5dc933aa6524a)
Diffstat (limited to 'apps/gendsa.c')
-rw-r--r-- | apps/gendsa.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/gendsa.c b/apps/gendsa.c index 27feb79..34f7af3 100644 --- a/apps/gendsa.c +++ b/apps/gendsa.c @@ -146,6 +146,8 @@ int gendsa_main(int argc, char **argv) goto end; } pkey = app_keygen(ctx, "DSA", nbits, verbose); + if (pkey == NULL) + goto end; assert(private); if (!PEM_write_bio_PrivateKey(out, pkey, enc, NULL, 0, NULL, passout)) { |