Avoid memory leak if preset ID lookup fails

This commit is contained in:
Chris Robinson
2014-04-14 01:33:31 -07:00
parent 7bc08bb08c
commit 9c70ca9da6
+1
View File
@@ -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);
}