]> git.alsa-project.org Git - alsa-lib.git/commitdiff
conf: fix parse_array_def - merge arrays
authorJaroslav Kysela <perex@perex.cz>
Thu, 18 Sep 2025 13:34:09 +0000 (15:34 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 3 Nov 2025 09:54:54 +0000 (10:54 +0100)
A tiny overlook caused wrong array merge. New compound member must be
always created.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/conf.c

index 4dfa9cc56edfe2c777983771365b316b8165a686..b9417a8aa7dee56983ff4e2b2715c456e1cb479d 100644 (file)
@@ -1274,7 +1274,7 @@ static int parse_array_def(snd_config_t *parent, input_t *input, int *idx, int s
                        if (_snd_config_search(parent, static_id, -1, &n) == 0) {
                                if (override) {
                                        snd_config_delete(n);
-                                       n = NULL;
+                                       /* fallthrough to break */
                                } else {
                                        /* merge */
                                        (*idx)++;
@@ -1283,6 +1283,7 @@ static int parse_array_def(snd_config_t *parent, input_t *input, int *idx, int s
                        }
                        break;
                }
+               n = NULL;
                id = strdup(static_id);
                if (id == NULL)
                        return -ENOMEM;