Skip to content

Commit

Permalink
Fix two memory leaks on CALLOC/FREE of ec_globals_alloc function, det…
Browse files Browse the repository at this point in the history
…ected by CFLAGS="-g -fsanitize=address"

Fixes: Ettercap#1201
  • Loading branch information
LocutusOfBorg committed Jan 26, 2023
1 parent 5c00382 commit dffb0a3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ec_globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ void ec_globals_free(void)
free_ip_list(ec_gbls->t2);
EC_GBL_FREE(ec_gbls->t2);

EC_GBL_FREE(ec_gbls->wifi);
EC_GBL_FREE(ec_gbls->env->name);
EC_GBL_FREE(ec_gbls->env->version);
EC_GBL_FREE(ec_gbls->env->debug_file);
Expand All @@ -102,6 +103,7 @@ void ec_globals_free(void)
EC_GBL_FREE(ec_gbls->conf);
/* destroy the list structure */
filter_clear();
EC_GBL_FREE(ec_gbls->ui);

EC_GBL_FREE(ec_gbls);

Expand Down

0 comments on commit dffb0a3

Please sign in to comment.