From efd18121d57349194fc76e83b2f1d6e7d4dee3f8 Mon Sep 17 00:00:00 2001 From: Christopher Schmitt Date: Fri, 19 May 2017 08:09:14 -0400 Subject: [PATCH] Review/Style Changes --- docs/changes.txt | 1 + src/status.c | 29 ++++++++++++++--------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 12daa60f2..17447f2d4 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -37,6 +37,7 @@ - Fixed a missing type specifier in a function declaration of the RACF kernel - Fixed a condition that caused a hybrid attack using a maskfile to not select all wordlists from a wordlist folder +- Fixed a memory leak that is present when a user is periodically printing hashcat status (using --status-timer) ## ## Technical diff --git a/src/status.c b/src/status.c index 7d6de613e..6087fa410 100644 --- a/src/status.c +++ b/src/status.c @@ -1809,25 +1809,24 @@ void status_ctx_destroy (hashcat_ctx_t *hashcat_ctx) void status_status_destroy (hashcat_status_t *status_ctx) { - if (NULL == status_ctx) - return; + if (NULL == status_ctx) return; - hcfree(status_ctx->session); - hcfree(status_ctx->time_estimated_absolute); - hcfree(status_ctx->time_estimated_relative); - hcfree(status_ctx->time_started_absolute); - hcfree(status_ctx->time_started_relative); - hcfree(status_ctx->speed_sec_all); - hcfree(status_ctx->guess_base); - hcfree(status_ctx->guess_mod); - hcfree(status_ctx->guess_charset); - hcfree(status_ctx->cpt); + hcfree (status_ctx->session); + hcfree (status_ctx->time_estimated_absolute); + hcfree (status_ctx->time_estimated_relative); + hcfree (status_ctx->time_started_absolute); + hcfree (status_ctx->time_started_relative); + hcfree (status_ctx->speed_sec_all); + hcfree (status_ctx->guess_base); + hcfree (status_ctx->guess_mod); + hcfree (status_ctx->guess_charset); + hcfree (status_ctx->cpt); for (int device_id = 0; device_id < status_ctx->device_info_cnt; device_id++) { device_info_t *device_info = status_ctx->device_info_buf + device_id; - hcfree(device_info->speed_sec_dev); - hcfree(device_info->guess_candidates_dev); - hcfree(device_info->hwmon_dev); + hcfree (device_info->speed_sec_dev); + hcfree (device_info->guess_candidates_dev); + hcfree (device_info->hwmon_dev); } } \ No newline at end of file