aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-12-08 06:20:01 -0800
committerChris Robinson <[email protected]>2013-12-08 06:20:44 -0800
commit5349b90a483b25bc5f41ba6545bbebf0843bdbdc (patch)
tree1c5f1bfd0d327654b395ccc5236ab13e18e0b3ab
parentac525db845ff0ecc2018f333d6d189db24ffcbfd (diff)
Fix leak if inserting a sysex event fails
-rw-r--r--OpenAL32/alMidi.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/OpenAL32/alMidi.c b/OpenAL32/alMidi.c
index 01fd13a9..8f9acd7d 100644
--- a/OpenAL32/alMidi.c
+++ b/OpenAL32/alMidi.c
@@ -158,7 +158,11 @@ static ALenum MidiSynth_insertSysExEvent(MidiSynth *self, ALuint64 time, const A
memcpy(entry.param.sysex.data, data, size);
err = InsertEvtQueue(&self->EventQueue, &entry);
- if(err != AL_NO_ERROR) return err;
+ if(err != AL_NO_ERROR)
+ {
+ free(entry.param.sysex.data);
+ return err;
+ }
if(entry.time < self->NextEvtTime)
{
@@ -256,8 +260,7 @@ static ALboolean FSynth_init(FSynth *self, ALCdevice *device)
static ALboolean FSynth_isSoundfont(FSynth *self, const char *filename)
{
filename = MidiSynth_getFontName(STATIC_CAST(MidiSynth, self), filename);
- if(!filename[0])
- return AL_FALSE;
+ if(!filename[0]) return AL_FALSE;
if(!fluid_is_soundfont(filename))
return AL_FALSE;
@@ -269,8 +272,7 @@ static ALenum FSynth_loadSoundfont(FSynth *self, const char *filename)
int fontid;
filename = MidiSynth_getFontName(STATIC_CAST(MidiSynth, self), filename);
- if(!filename[0])
- return AL_INVALID_VALUE;
+ if(!filename[0]) return AL_INVALID_VALUE;
fontid = fluid_synth_sfload(self->Synth, filename, 1);
if(fontid == FLUID_FAILED)