Skip to content

Commit

Permalink
Fix a possible memleak in apps/rehash.c
Browse files Browse the repository at this point in the history
The OPENSSL_DIR_end was missing in case of error.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #22920)
  • Loading branch information
bernd-edlinger authored and t8m committed Dec 12, 2023
1 parent ba4d833 commit 01709fc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions apps/rehash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 01709fc

Please sign in to comment.