fix mem leak
This commit is contained in:
@@ -274,6 +274,8 @@ static void session_flags_load_config(struct session_flags_plugin_info *sf_plugi
|
||||
if (toml_val.ok)
|
||||
{
|
||||
strncpy(g_sf_conf->tunneling_pcre_list, toml_val.u.s, sizeof(g_sf_conf->tunneling_pcre_list) - 1);
|
||||
free(toml_val.u.s);
|
||||
toml_val.u.s = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -284,11 +286,15 @@ static void session_flags_load_config(struct session_flags_plugin_info *sf_plugi
|
||||
if (toml_val.ok)
|
||||
{
|
||||
strncpy(g_sf_conf->random_looking_judge_list, toml_val.u.s, sizeof(g_sf_conf->random_looking_judge_list) - 1);
|
||||
free(toml_val.u.s);
|
||||
toml_val.u.s = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy(g_sf_conf->random_looking_judge_list, "{\"random_looking_judge_list\":[]}", sizeof(g_sf_conf->random_looking_judge_list) - 1);
|
||||
}
|
||||
|
||||
toml_free(toml_root);
|
||||
}
|
||||
|
||||
extern "C" void *session_flags_plugin_init(struct stellar *st)
|
||||
|
||||
Reference in New Issue
Block a user