Browse Source

AddPulseAudioDevice(): Fix use-after-free

Petar Popovic 2 months ago
parent
commit
6aef6ae9a8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/audio/pulseaudio/SDL_pulseaudio.c

+ 1 - 1
src/audio/pulseaudio/SDL_pulseaudio.c

@@ -778,8 +778,8 @@ static void AddPulseAudioDevice(const bool recording, const char *description, c
             SDL_free(handle);
         } else {
             handle->device_index = index;
+            SDL_AddAudioDevice(recording, description, &spec, handle);
         }
-        SDL_AddAudioDevice(recording, description, &spec, handle);
     }
 }