aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alSoundfont.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-04-14 01:33:31 -0700
committerChris Robinson <[email protected]>2014-04-14 01:33:31 -0700
commit9c70ca9da6479595946def59cd616e6823c86d78 (patch)
treed28e82183b709eb3f811338d0e071b504d41e22b /OpenAL32/alSoundfont.c
parent7bc08bb08cf88cd5d96256461e0c9299a0bf47e8 (diff)
Avoid memory leak if preset ID lookup fails
Diffstat (limited to 'OpenAL32/alSoundfont.c')
-rw-r--r--OpenAL32/alSoundfont.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/OpenAL32/alSoundfont.c b/OpenAL32/alSoundfont.c
index a89ce4d1..0952c412 100644
--- a/OpenAL32/alSoundfont.c
+++ b/OpenAL32/alSoundfont.c
@@ -350,6 +350,7 @@ AL_API void AL_APIENTRY alSoundfontPresetsSOFT(ALuint id, ALsizei count, const A
{
if(!(presets[i]=LookupPreset(device, pids[i])))
{
+ free(presets);
WriteUnlock(&sfont->Lock);
SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);
}