]> git.alsa-project.org Git - alsa-lib.git/commitdiff
control: remap - assign right name to the child handle for no-op
authorJaroslav Kysela <perex@perex.cz>
Tue, 29 Jun 2021 16:02:27 +0000 (18:02 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 29 Jun 2021 16:02:30 +0000 (18:02 +0200)
Fixes: https://github.com/alsa-project/alsa-utils/issues/100
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/control/control_remap.c

index a85c1725ad3930504493ffa3a71d31ef4491440b..81524014aca5caa26da23d4840dec455bce6fd3c 100644 (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;
        }