From 765a43a0ffcf4b89ea38ee3181b8039f823d9da6 Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Fri, 29 Mar 2024 12:25:03 -0400 Subject: [PATCH] ao_alsa: fix snd_config memory leak During AO init, snd_pcm_open() is called, which calls snd_config_update() to allocate a global config node and stores it in the snd_config global variable. This is never freed on uninit. Fix this by freeing the global config node on uninit. --- audio/out/ao_alsa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c index 75eda3bbf8..92ea0db237 100644 --- a/audio/out/ao_alsa.c +++ b/audio/out/ao_alsa.c @@ -623,7 +623,8 @@ static void uninit(struct ao *ao) CHECK_ALSA_ERROR("pcm close error"); } -alsa_error: ; +alsa_error: + snd_config_update_free_global(); } #define INIT_DEVICE_ERR_GENERIC -1