From aed01460f2e38553f5d056fe3d7c6fa09f5cb072 Mon Sep 17 00:00:00 2001 From: philsmd Date: Tue, 14 Feb 2017 17:02:52 +0100 Subject: [PATCH] if fstat () fails we shouldn't forget to close the file --- src/outfile_check.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/outfile_check.c b/src/outfile_check.c index 79c4e1522..6d17f3981 100644 --- a/src/outfile_check.c +++ b/src/outfile_check.c @@ -142,7 +142,12 @@ static int outfile_remove (hashcat_ctx_t *hashcat_ctx) hc_stat_t outfile_stat; - if (hc_fstat (fileno (fp), &outfile_stat)) continue; + if (hc_fstat (fileno (fp), &outfile_stat)) + { + close (fp); + + continue; + } if (outfile_stat.st_ctime > out_info[j].ctime) {