mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-01-19 07:50:49 +00:00
fix memory leaks during sfont loading
This commit is contained in:
parent
08147cc3d6
commit
71592ec679
2 changed files with 8 additions and 7 deletions
|
@ -81,20 +81,20 @@ fluid_sfont_t* fluid_defsfloader_load(fluid_sfloader_t* loader, const char* file
|
|||
fluid_defsfont_sfont_delete);
|
||||
if (sfont == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
defsfont->sfont = sfont;
|
||||
|
||||
if (fluid_defsfont_load(defsfont, &loader->file_callbacks, filename) == FLUID_FAILED) {
|
||||
delete_fluid_defsfont(defsfont);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
fluid_sfont_set_iteration_start(sfont, fluid_defsfont_sfont_iteration_start);
|
||||
fluid_sfont_set_iteration_next(sfont, fluid_defsfont_sfont_iteration_next);
|
||||
fluid_sfont_set_data(sfont, defsfont);
|
||||
|
||||
defsfont->sfont = sfont;
|
||||
if (fluid_defsfont_load(defsfont, &loader->file_callbacks, filename) == FLUID_FAILED) {
|
||||
fluid_sfont_delete_internal(sfont);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return sfont;
|
||||
}
|
||||
|
||||
|
|
|
@ -95,6 +95,7 @@ fluid_ramsfont_create_sfont()
|
|||
fluid_ramsfont_sfont_delete);
|
||||
if (sfont == NULL)
|
||||
{
|
||||
delete_fluid_ramsfont(ramsfont);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue