1
0
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:
Jens Steube 2020-06-02 12:34:19 +02:00 committed by GitHub
commit 4aaec30ada
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
38 changed files with 52 additions and 52 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -511,7 +511,7 @@ void setup_environment_variables (const folder_config_t *folder_config)
putenv (display);
free (display);
hcfree (display);
}
else
{

View File

@ -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;

View File

@ -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;