1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-14 11:48:57 +00:00

Merge pull request #2836 from Xanadrel/fix-memleak-status

Fix memory leak with status (with brain enabled)
This commit is contained in:
Jens Steube 2021-06-18 21:17:12 +02:00 committed by GitHub
commit 762e487c5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -1775,6 +1775,8 @@ int hashcat_get_status (hashcat_ctx_t *hashcat_ctx, hashcat_status_t *hashcat_st
#ifdef WITH_BRAIN
hashcat_status->brain_session = status_get_brain_session (hashcat_ctx);
hashcat_status->brain_attack = status_get_brain_attack (hashcat_ctx);
hashcat_status->brain_rx_all = status_get_brain_rx_all (hashcat_ctx);
hashcat_status->brain_tx_all = status_get_brain_tx_all (hashcat_ctx);
#endif
hashcat_status->status_string = status_get_status_string (hashcat_ctx);
hashcat_status->status_number = status_get_status_number (hashcat_ctx);
@ -1827,8 +1829,6 @@ int hashcat_get_status (hashcat_ctx_t *hashcat_ctx, hashcat_status_t *hashcat_st
device_info->brain_link_send_bytes_dev = status_get_brain_link_send_bytes_dev (hashcat_ctx, device_id);
device_info->brain_link_recv_bytes_sec_dev = status_get_brain_link_recv_bytes_sec_dev (hashcat_ctx, device_id);
device_info->brain_link_send_bytes_sec_dev = status_get_brain_link_send_bytes_sec_dev (hashcat_ctx, device_id);
hashcat_status->brain_rx_all = status_get_brain_rx_all (hashcat_ctx);
hashcat_status->brain_tx_all = status_get_brain_tx_all (hashcat_ctx);
#endif
}

View File

@ -2268,6 +2268,10 @@ void status_status_destroy (hashcat_ctx_t *hashcat_ctx, hashcat_status_t *hashca
hcfree (hashcat_status->guess_mod);
hcfree (hashcat_status->guess_charset);
hcfree (hashcat_status->cpt);
#ifdef WITH_BRAIN
hcfree (hashcat_status->brain_rx_all);
hcfree (hashcat_status->brain_tx_all);
#endif
hashcat_status->hash_target = NULL;
hashcat_status->hash_name = NULL;
@ -2281,6 +2285,10 @@ void status_status_destroy (hashcat_ctx_t *hashcat_ctx, hashcat_status_t *hashca
hashcat_status->guess_mod = NULL;
hashcat_status->guess_charset = NULL;
hashcat_status->cpt = NULL;
#ifdef WITH_BRAIN
hashcat_status->brain_rx_all = NULL;
hashcat_status->brain_tx_all = NULL;
#endif
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
{