Fix missing free() for memory allocated with asprintf()

pull/1385/head
jsteube 7 years ago
parent 6c251d48a4
commit 583849cd23

@ -136,6 +136,9 @@ 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);
return -1;
}
@ -145,6 +148,9 @@ 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);
return -1;
}
@ -211,6 +217,9 @@ 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);
return -1;
}
@ -220,11 +229,17 @@ 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);
return -1;
}
unlink (old_hashfile);
free (new_hashfile);
free (old_hashfile);
return 0;
}

@ -4458,6 +4458,8 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
CL_rc = hc_clBuildProgram (hashcat_ctx, device_param->program, 1, &device_param->device, build_opts_update, NULL, NULL);
free (build_opts_update);
//if (CL_rc == -1) return -1;
size_t build_log_size = 0;

@ -304,11 +304,13 @@ void setup_environment_variables ()
if (compute)
{
static char *display;
char *display;
hc_asprintf (&display, "DISPLAY=%s", compute);
putenv (display);
free (display);
}
else
{

Loading…
Cancel
Save