mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-12-02 17:12:15 +00:00
Fix a memory leak if a setting is registered multiple times (#844)
If a string setting is registered multiple times, the previous default value wasn't freed, leading to a memory leak.
This commit is contained in:
parent
aad6288955
commit
aa966e4c31
1 changed files with 1 additions and 0 deletions
|
@ -546,6 +546,7 @@ fluid_settings_register_str(fluid_settings_t *settings, const char *name, const
|
|||
if(node->type == FLUID_STR_TYPE)
|
||||
{
|
||||
fluid_str_setting_t *setting = &node->str;
|
||||
FLUID_FREE(setting->def);
|
||||
setting->def = def ? FLUID_STRDUP(def) : NULL;
|
||||
setting->hints = hints;
|
||||
retval = FLUID_OK;
|
||||
|
|
Loading…
Reference in a new issue