From e47c11822d6b459a9b3704b3ee6a4a5c9a1b85be Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 29 Jun 2021 18:02:27 +0200 Subject: [PATCH] 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 --- src/control/control_remap.c | 4 ++++ 1 file changed, 4 insertions(+) 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; } -- 2.47.1