Skip to content

Commit

Permalink
Fix: doble free (#1779)
Browse files Browse the repository at this point in the history
The hash table used for storing files was destroyed twice.
  • Loading branch information
jjnicola authored Dec 9, 2024
1 parent 751266a commit 0608824
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/attack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,6 @@ attack_network (struct scan_globals *globals)
gvm_host_t *host;
plugins_scheduler_t sched;
int fork_retries = 0;
GHashTable *files;
struct timeval then, now;
gvm_hosts_t *hosts;
const gchar *port_range;
Expand Down Expand Up @@ -1383,7 +1382,7 @@ attack_network (struct scan_globals *globals)
if (rc < 0 && rc != -2)
{
report_kb_failure (rc);
goto scan_stop;
goto stop;
}
else if (rc == -2)
{
Expand All @@ -1400,7 +1399,7 @@ attack_network (struct scan_globals *globals)
{
kb_delete (arg_host_kb);
g_free (host_str);
goto scan_stop;
goto stop;
}

if (scan_is_stopped ())
Expand Down Expand Up @@ -1513,12 +1512,6 @@ attack_network (struct scan_globals *globals)

g_debug ("Test complete");

scan_stop:
/* Free the memory used by the files uploaded by the user, if any. */
files = globals->files_translation;
if (files)
g_hash_table_destroy (files);

stop:

if (test_alive_hosts_only)
Expand Down

0 comments on commit 0608824

Please sign in to comment.