]> git.alsa-project.org Git - alsa-lib.git/commit
pcm: chmap: Fix memory leak at snd_pcm_set_chmap()
authorTakashi Iwai <tiwai@suse.de>
Tue, 24 Sep 2019 11:48:37 +0000 (13:48 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 24 Sep 2019 11:48:37 +0000 (13:48 +0200)
commit0732e47e6b471fee956c260ca512de52f3782e7e
treefd2154fc7f968bfd75e89782e247816a5e4efbce
parent1d7a131f781fa8b5c711ee9b585b334733e91b0c
pcm: chmap: Fix memory leak at snd_pcm_set_chmap()

snd_pcm_set_chmap() leaks the memory returned from snd_pcm_get_chmap()
without releasing.  Add the missing free() call as well as a slight
code refactoring.

Reported-by: Conrad Jones
BugLink: https://github.com/alsa-project/alsa-lib/pull/11
Fixes: d20e24e5d161 ("chmap: Always succeed setting the map to what it already is")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm.c