mirror of
https://github.com/hashcat/hashcat.git
synced 2024-12-23 07:08:19 +00:00
Merge pull request #2404 from philsmd/master
use our safe free () wrapper hcfree whenever possible
This commit is contained in:
commit
4aaec30ada
24
src/hashes.c
24
src/hashes.c
@ -182,8 +182,8 @@ int save_hash (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: %s", new_hashfile, strerror (errno));
|
||||
|
||||
free (new_hashfile);
|
||||
free (old_hashfile);
|
||||
hcfree (new_hashfile);
|
||||
hcfree (old_hashfile);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -194,8 +194,8 @@ int save_hash (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
event_log_error (hashcat_ctx, "%s: %s", new_hashfile, strerror (errno));
|
||||
|
||||
free (new_hashfile);
|
||||
free (old_hashfile);
|
||||
hcfree (new_hashfile);
|
||||
hcfree (old_hashfile);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -256,8 +256,8 @@ int save_hash (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
event_log_error (hashcat_ctx, "%s: %s", new_hashfile, strerror (errno));
|
||||
|
||||
free (new_hashfile);
|
||||
free (old_hashfile);
|
||||
hcfree (new_hashfile);
|
||||
hcfree (old_hashfile);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -270,8 +270,8 @@ int save_hash (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Rename file '%s' to '%s': %s", hashfile, old_hashfile, strerror (errno));
|
||||
|
||||
free (new_hashfile);
|
||||
free (old_hashfile);
|
||||
hcfree (new_hashfile);
|
||||
hcfree (old_hashfile);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -282,16 +282,16 @@ int save_hash (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Rename file '%s' to '%s': %s", new_hashfile, hashfile, strerror (errno));
|
||||
|
||||
free (new_hashfile);
|
||||
free (old_hashfile);
|
||||
hcfree (new_hashfile);
|
||||
hcfree (old_hashfile);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
unlink (old_hashfile);
|
||||
|
||||
free (new_hashfile);
|
||||
free (old_hashfile);
|
||||
hcfree (new_hashfile);
|
||||
hcfree (old_hashfile);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -374,7 +374,7 @@ u32 hlfmt_detect (hashcat_ctx_t *hashcat_ctx, HCFILE *fp, u32 max_check)
|
||||
hashlist_format = i;
|
||||
}
|
||||
|
||||
free (formats_cnt);
|
||||
hcfree (formats_cnt);
|
||||
|
||||
return hashlist_format;
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -199,7 +199,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -197,7 +197,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -181,7 +181,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -181,7 +181,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -179,7 +179,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -180,7 +180,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -180,7 +180,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -180,7 +180,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -193,7 +193,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -193,7 +193,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -193,7 +193,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -209,7 +209,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -209,7 +209,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -209,7 +209,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -210,7 +210,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -210,7 +210,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -210,7 +210,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -209,7 +209,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -209,7 +209,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -209,7 +209,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -211,7 +211,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -211,7 +211,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -211,7 +211,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -228,7 +228,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -228,7 +228,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -228,7 +228,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -230,7 +230,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -230,7 +230,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -230,7 +230,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -213,7 +213,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -213,7 +213,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -213,7 +213,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
keyfile = strtok_r ((char *) NULL, ",", &saveptr);
|
||||
}
|
||||
|
||||
free (keyfiles);
|
||||
hcfree (keyfiles);
|
||||
}
|
||||
|
||||
// keyboard layout mapping
|
||||
|
@ -511,7 +511,7 @@ void setup_environment_variables (const folder_config_t *folder_config)
|
||||
|
||||
putenv (display);
|
||||
|
||||
free (display);
|
||||
hcfree (display);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -323,7 +323,7 @@ char *status_get_hash_target (const hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
tmp_buf2[tmp_len] = 0;
|
||||
|
||||
free (tmp_buf);
|
||||
hcfree (tmp_buf);
|
||||
|
||||
return tmp_buf2;
|
||||
}
|
||||
@ -343,7 +343,7 @@ char *status_get_hash_target (const hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
char *tmp_buf2 = strdup (tmp_buf);
|
||||
|
||||
free (tmp_buf);
|
||||
hcfree (tmp_buf);
|
||||
|
||||
return tmp_buf2;
|
||||
}
|
||||
@ -1097,14 +1097,14 @@ char *status_get_time_estimated_relative (const hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
snprintf (display, HCBUFSIZ_TINY, "%s; Runtime limited: %s", tmp_display, display_left);
|
||||
|
||||
free (display_left);
|
||||
hcfree (display_left);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf (display, HCBUFSIZ_TINY, "%s; Runtime limit exceeded", tmp_display);
|
||||
}
|
||||
|
||||
free (tmp_display);
|
||||
hcfree (tmp_display);
|
||||
}
|
||||
|
||||
return display;
|
||||
|
@ -1068,7 +1068,7 @@ void status_display_status_json (hashcat_ctx_t *hashcat_ctx)
|
||||
printf (" \"rejected\": %" PRIu64 ",", hashcat_status->progress_rejected);
|
||||
printf (" \"devices\": [");
|
||||
|
||||
free (target_json_encoded);
|
||||
hcfree (target_json_encoded);
|
||||
|
||||
int device_num = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user