Epplet_load_config(): Fix memory leak when called more than once

This commit is contained in:
Kim Woelders 2021-08-27 17:05:39 +02:00
parent b09b798681
commit 9e2045a54b
1 changed files with 6 additions and 4 deletions

View File

@ -5609,10 +5609,12 @@ Epplet_load_config(void)
if (epplet_instance == 0)
return;
/* create config file name */
snprintf(s, sizeof(s), "%s/%s.cfg", conf_dir, epplet_name);
epplet_cfg_file = strdup(s);
if (!epplet_cfg_file)
{
/* create config file name */
snprintf(s, sizeof(s), "%s/%s.cfg", conf_dir, epplet_name);
epplet_cfg_file = strdup(s);
}
Epplet_load_config_file(epplet_cfg_file);
}