pcm: chmap: Fix memory leak at snd_pcm_set_chmap()
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 <4596b3305151c7ee743192a95d394341e3d3b644@suse.de>

alsa-project/alsa-lib,tiwai/alsa-lib,tiwai/alsa-lib,alsa-project/alsa-lib,alsa-project/alsa-lib,takaswie/alsa-lib,takaswie/alsa-lib,tiwai/alsa-lib,takaswie/alsa-lib,tiwai/alsa-lib,takaswie/alsa-lib,takaswie/alsa-lib,alsa-project/alsa-lib