From: Jaroslav Kysela Date: Tue, 29 Jun 2021 16:02:27 +0000 (+0200) Subject: control: remap - assign right name to the child handle for no-op X-Git-Tag: v1.2.6~38 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=e47c11822d6b459a9b3704b3ee6a4a5c9a1b85be;p=alsa-lib.git 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 --- diff --git a/src/control/control_remap.c b/src/control/control_remap.c index a85c1725..81524014 100644 --- a/src/control/control_remap.c +++ b/src/control/control_remap.c @@ -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; }