Skip to content

Commit

Permalink
Fixed possible heap-after-free when reusing proxyres.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmoinvaz committed Nov 30, 2023
1 parent 0a9d9a0 commit ca6e7c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion config.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,14 @@ bool proxy_config_global_init(void) {
bool proxy_config_global_cleanup(void) {
if (--g_proxy_config.ref_count > 0)
return true;

free(g_proxy_config.auto_config_url);
free(g_proxy_config.proxy);
free(g_proxy_config.bypass_list);

if (g_proxy_config.proxy_config_i)
return g_proxy_config.proxy_config_i->global_cleanup();
g_proxy_config.proxy_config_i->global_cleanup();

memset(&g_proxy_config, 0, sizeof(g_proxy_config));
return false;
}

0 comments on commit ca6e7c3

Please sign in to comment.