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

pull/1073/head
jsteube 7 years ago
parent a9b0f1a559
commit 9b1ce502b8

@ -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
- 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 hash-file writing (in case of --remove) failed
- 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
- Outfile Check: Fixed a memory leak for failed outfile reads

@ -102,12 +102,19 @@ static int monitor (hashcat_ctx_t *hashcat_ctx)
// 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
int *temp_diff_old = (int *) hccalloc (opencl_ctx->devices_cnt, sizeof (int));
int *temp_diff_sum = (int *) hccalloc (opencl_ctx->devices_cnt, sizeof (int));
int temp_diff_old[DEVICES_MAX];
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;
@ -405,11 +412,6 @@ static int monitor (hashcat_ctx_t *hashcat_ctx)
if (rc == -1) return -1;
}
hcfree (fan_speed_chgd);
hcfree (temp_diff_old);
hcfree (temp_diff_sum);
return 0;
}

Loading…
Cancel
Save