control: remap - assign right name to the child handle for no-op

Fixes: https://github.com/alsa-project/alsa-utils/issues/100
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2021-06-29 18:02:27 +02:00
parent 1a1f0fb244
commit e47c11822d

View file

@ -1173,6 +1173,10 @@ int snd_ctl_remap_open(snd_ctl_t **handlep, const char *name, snd_config_t *rema
/* no-op check, remove the plugin */
if (priv->map_items == 0 && priv->remap_items == 0) {
remap_free(priv);
free(child->name);
child->name = name ? strdup(name) : NULL;
if (name && !child->name)
return -ENOMEM;
*handlep = child;
return 0;
}