diff options
author | nanahi <130121847+na-na-hi@users.noreply.github.com> | 2024-03-29 12:25:03 -0400 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2024-03-30 10:09:37 +0100 |
commit | 765a43a0ffcf4b89ea38ee3181b8039f823d9da6 (patch) | |
tree | 25d7709c1c499fe4739d4f2cd0efd0ee777d75bb /audio | |
parent | cb82ad73f22a0d6338a6385f46f86bc7f3787909 (diff) | |
download | mpv-765a43a0ffcf4b89ea38ee3181b8039f823d9da6.tar.bz2 mpv-765a43a0ffcf4b89ea38ee3181b8039f823d9da6.tar.xz |
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.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/out/ao_alsa.c | 3 |
1 files changed, 2 insertions, 1 deletions
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 |