From f3d8a2def5e2214290bbbc075a6381fa9b753acf Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 9 Dec 2023 15:41:45 -0500 Subject: [PATCH] audio: Fixed resource leak in unlikely failure case during device add. --- src/audio/SDL_audio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 54f74d89b1..c43506426e 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -551,6 +551,8 @@ static SDL_AudioDevice *CreatePhysicalAudioDevice(const char *name, SDL_bool isc if (SDL_InsertIntoHashTable(current_audio.device_hash, (const void *) (uintptr_t) device->instance_id, device)) { SDL_AtomicAdd(device_count, 1); } else { + SDL_DestroyCondition(device->close_cond); + SDL_DestroyMutex(device->lock); SDL_free(device->name); SDL_free(device); device = NULL;