From f4a567a01d1e6c367e1fabe79dc972bd280a0e1e Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Fri, 21 Jun 2019 21:35:24 +0200 Subject: [PATCH] remove redundant fclose --- src/combinator.c | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/src/combinator.c b/src/combinator.c index a0c3f16eb..a8fd4f3ef 100644 --- a/src/combinator.c +++ b/src/combinator.c @@ -111,13 +111,13 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx) const int rc2 = count_words (hashcat_ctx, fp2, dictfile2, &words2_cnt); + fclose (fp1); + fclose (fp2); + if (rc2 == -1) { event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of wordlist: %s", dictfile2); - fclose (fp1); - fclose (fp2); - return -1; } @@ -125,15 +125,9 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx) { event_log_error (hashcat_ctx, "%s: empty file.", dictfile2); - fclose (fp1); - fclose (fp2); - return -1; } - fclose (fp1); - fclose (fp2); - combinator_ctx->dict1 = dictfile1; combinator_ctx->dict2 = dictfile2; @@ -220,13 +214,13 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx) const int rc2 = count_words (hashcat_ctx, fp2, dictfile2, &words2_cnt); + fclose (fp1); + fclose (fp2); + if (rc2 == -1) { event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of wordlist: %s", dictfile2); - fclose (fp1); - fclose (fp2); - return -1; } @@ -234,15 +228,9 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx) { event_log_error (hashcat_ctx, "%s: empty file.", dictfile2); - fclose (fp1); - fclose (fp2); - return -1; } - fclose (fp1); - fclose (fp2); - combinator_ctx->dict1 = dictfile1; combinator_ctx->dict2 = dictfile2; @@ -357,13 +345,13 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx) const int rc2 = count_words (hashcat_ctx, fp2, dictfile2, &words2_cnt); + fclose (fp1); + fclose (fp2); + if (rc2 == -1) { event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of wordlist: %s", dictfile2); - fclose (fp1); - fclose (fp2); - return -1; } @@ -371,15 +359,9 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx) { event_log_error (hashcat_ctx, "%s: empty file.", dictfile2); - fclose (fp1); - fclose (fp2); - return -1; } - fclose (fp1); - fclose (fp2); - combinator_ctx->dict1 = dictfile1; combinator_ctx->dict2 = dictfile2;