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.
This commit is contained in:
nanahi 2024-03-29 12:25:03 -04:00 committed by sfan5
parent cb82ad73f2
commit 765a43a0ff
1 changed files with 2 additions and 1 deletions

View File

@ -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