From: Bernd Edlinger Date: Sun, 3 Dec 2023 10:29:52 +0000 (+0100) Subject: Fix a possible memleak in apps/rehash.c X-Git-Tag: openssl-3.0.13~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d69f78383b376f72eb1595865c0d3a723382776;p=thirdparty%2Fopenssl.git Fix a possible memleak in apps/rehash.c The OPENSSL_DIR_end was missing in case of error. Reviewed-by: Shane Lontis Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/22920) (cherry picked from commit 01709fcb8b609cfc47e277d20492c333bafb113e) --- diff --git a/apps/rehash.c b/apps/rehash.c index d63a0909a2b..85eee385794 100644 --- a/apps/rehash.c +++ b/apps/rehash.c @@ -383,6 +383,7 @@ static int do_dir(const char *dirname, enum Hash h) if ((copy = OPENSSL_strdup(filename)) == NULL || sk_OPENSSL_STRING_push(files, copy) == 0) { OPENSSL_free(copy); + OPENSSL_DIR_end(&d); BIO_puts(bio_err, "out of memory\n"); errs = 1; goto err;