AddPulseAudioDevice(): Fix use-after-free

This commit is contained in:
Petar Popovic 2025-02-17 19:13:42 +01:00 committed by Sam Lantinga
parent 3b4cfc11f0
commit 6aef6ae9a8
1 changed files with 1 additions and 1 deletions

View File

@ -778,10 +778,10 @@ static void AddPulseAudioDevice(const bool recording, const char *description, c
SDL_free(handle);
} else {
handle->device_index = index;
}
SDL_AddAudioDevice(recording, description, &spec, handle);
}
}
}
// This is called when PulseAudio adds an playback ("sink") device.
static void SinkInfoCallback(pa_context *c, const pa_sink_info *i, int is_last, void *data)