1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-23 00:28:11 +00:00

Hardware Monitor: Fixed several memory leaks in case hash-file writing (in case of --remove) failed

This commit is contained in:
jsteube 2017-02-14 16:00:10 +01:00
parent a9b0f1a559
commit 9b1ce502b8
2 changed files with 11 additions and 8 deletions

View File

@ -66,6 +66,7 @@
- Files: Do several file and folder checks on startup rather than when they are actually used to avoid related error after eventual intense operations - Files: Do several file and folder checks on startup rather than when they are actually used to avoid related error after eventual intense operations
- Helper: Added functions to check existence, type, read- and write-permissions and rewrite sources to use them instead of stat() - Helper: Added functions to check existence, type, read- and write-permissions and rewrite sources to use them instead of stat()
- Hardware Monitor: Fixed several memory leaks in case no hardware monitor sensor is found - Hardware Monitor: Fixed several memory leaks in case no hardware monitor sensor is found
- Hardware Monitor: Fixed several memory leaks in case hash-file writing (in case of --remove) failed
- Mask Increment: Fixed memory leak in case mask_append() fails - Mask Increment: Fixed memory leak in case mask_append() fails
- OpenCL Device Management: Fixed several memory leaks in case initialization of an OpenCL device or platform failed - OpenCL Device Management: Fixed several memory leaks in case initialization of an OpenCL device or platform failed
- Outfile Check: Fixed a memory leak for failed outfile reads - Outfile Check: Fixed a memory leak for failed outfile reads

View File

@ -102,12 +102,19 @@ static int monitor (hashcat_ctx_t *hashcat_ctx)
// these variables are mainly used for fan control // these variables are mainly used for fan control
int *fan_speed_chgd = (int *) hccalloc (opencl_ctx->devices_cnt, sizeof (int)); int fan_speed_chgd[DEVICES_MAX];
memset (fan_speed_chgd, 0, sizeof (fan_speed_chgd));
// temperature controller "loopback" values // temperature controller "loopback" values
int *temp_diff_old = (int *) hccalloc (opencl_ctx->devices_cnt, sizeof (int)); int temp_diff_old[DEVICES_MAX];
int *temp_diff_sum = (int *) hccalloc (opencl_ctx->devices_cnt, sizeof (int)); int temp_diff_sum[DEVICES_MAX];
memset (temp_diff_old, 0, sizeof (temp_diff_old));
memset (temp_diff_sum, 0, sizeof (temp_diff_sum));
// timer
time_t last_temp_check_time; time_t last_temp_check_time;
@ -405,11 +412,6 @@ static int monitor (hashcat_ctx_t *hashcat_ctx)
if (rc == -1) return -1; if (rc == -1) return -1;
} }
hcfree (fan_speed_chgd);
hcfree (temp_diff_old);
hcfree (temp_diff_sum);
return 0; return 0;
} }