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 Nov 25, 2022
1 parent cd5c4b6 commit 4a1c87e
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 4a1c87e

Please sign in to comment.