From 8f4d93f938e2b7881d8fc5548d718a4c9b7362a5 Mon Sep 17 00:00:00 2001 From: jsteube Date: Mon, 14 Nov 2016 14:07:30 +0100 Subject: [PATCH] Fix some double-free if manually setting --outfile-check-dir --- src/outfile_check.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/outfile_check.c b/src/outfile_check.c index 80e01e29e..53a8997a5 100644 --- a/src/outfile_check.c +++ b/src/outfile_check.c @@ -378,6 +378,7 @@ int outcheck_ctx_init (hashcat_ctx_t *hashcat_ctx) void outcheck_ctx_destroy (hashcat_ctx_t *hashcat_ctx) { outcheck_ctx_t *outcheck_ctx = hashcat_ctx->outcheck_ctx; + user_options_t *user_options = hashcat_ctx->user_options; if (outcheck_ctx->enabled == false) return; @@ -399,7 +400,10 @@ void outcheck_ctx_destroy (hashcat_ctx_t *hashcat_ctx) } } - hcfree (outcheck_ctx->root_directory); + if (user_options->outfile_check_dir == NULL) + { + hcfree (outcheck_ctx->root_directory); + } memset (outcheck_ctx, 0, sizeof (outcheck_ctx_t)); }