Skip to content

Commit

Permalink
fix: memory leak when reloading config settings
Browse files Browse the repository at this point in the history
  • Loading branch information
JFreegman committed Jan 30, 2025
1 parent cb4e3a7 commit a33c81a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,7 @@ int settings_load_main(Client_Config *s, const Run_Options *run_opts)
void settings_reload(Toxic *toxic)
{
Client_Config *c_config = toxic->c_config;
Client_Data *client_data = &toxic->client_data;
const Run_Options *run_opts = toxic->run_opts;
Windows *windows = toxic->windows;

Expand Down Expand Up @@ -1101,7 +1102,10 @@ void settings_reload(Toxic *toxic)
}


ret = settings_load_blocked_words(&toxic->client_data, run_opts);

free_ptr_array((void **) client_data->blocked_words);

ret = settings_load_blocked_words(client_data, run_opts);

if (ret < 0) {
fprintf(stderr, "Failed to reload blocked words list (error %d)\n", ret);
Expand Down

0 comments on commit a33c81a

Please sign in to comment.