mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-12-03 17:42:21 +00:00
Fix segfault / memory leak in error paths
Patch credit: surabhi-mishra
This commit is contained in:
parent
d7d7fb1103
commit
2f6aa0e9e6
2 changed files with 3 additions and 2 deletions
|
@ -281,6 +281,7 @@ fluid_sequencer_register_client (fluid_sequencer_t* seq, const char *name,
|
|||
nameCopy = FLUID_STRDUP(name);
|
||||
if (nameCopy == NULL) {
|
||||
fluid_log(FLUID_PANIC, "sequencer: Out of memory\n");
|
||||
FLUID_FREE(client);
|
||||
return FLUID_FAILED;
|
||||
}
|
||||
|
||||
|
|
|
@ -3115,7 +3115,7 @@ fluid_synth_sfload(fluid_synth_t* synth, const char* filename, int reset_presets
|
|||
|
||||
if (!sfont_info)
|
||||
{
|
||||
delete_fluid_sfont (sfont_info->sfont); /* FIXME - Shouldn't fail right? - JG */
|
||||
delete_fluid_sfont (sfont);
|
||||
FLUID_API_RETURN(FLUID_FAILED);
|
||||
}
|
||||
|
||||
|
@ -3295,7 +3295,7 @@ fluid_synth_sfreload(fluid_synth_t* synth, unsigned int id)
|
|||
|
||||
if (!sfont_info)
|
||||
{
|
||||
delete_fluid_sfont (sfont_info->sfont); /* FIXME - Shouldn't fail right? - JG */
|
||||
delete_fluid_sfont (sfont);
|
||||
FLUID_API_RETURN(FLUID_FAILED);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue