mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-05-31 21:38:37 -04:00
fix memory leak in snd_pcm_set_chmap
This commit is contained in:
parent
1d7a131f78
commit
d201a058cc
1 changed files with 6 additions and 1 deletions
|
|
@ -8100,8 +8100,13 @@ snd_pcm_chmap_t *snd_pcm_get_chmap(snd_pcm_t *pcm)
|
|||
int snd_pcm_set_chmap(snd_pcm_t *pcm, const snd_pcm_chmap_t *map)
|
||||
{
|
||||
const snd_pcm_chmap_t *oldmap = snd_pcm_get_chmap(pcm);
|
||||
if (oldmap && chmap_equal(oldmap, map))
|
||||
if (oldmap && chmap_equal(oldmap, map)) {
|
||||
free(oldmap);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (oldmap)
|
||||
free(oldmap);
|
||||
|
||||
if (!pcm->ops->set_chmap)
|
||||
return -ENXIO;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue