]> git.alsa-project.org Git - alsa-utils.git/commitdiff
topology: fix possible double free in load()
authorJaroslav Kysela <perex@perex.cz>
Fri, 8 Jan 2021 17:33:28 +0000 (18:33 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 8 Jan 2021 17:33:28 +0000 (18:33 +0100)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
topology/topology.c

index d52b1452fdc27adfe46316c5618bdeb14bec648b..c2f0943242666f74a22bc97d75fdf995059b5f84 100644 (file)
@@ -100,10 +100,8 @@ static int load(const char *source_file, void **dst, size_t *dst_size)
                pos += r;
                size += 8*1024;
                buf2 = realloc(buf, size);
-               if (buf2 == NULL) {
-                       free(buf);
+               if (buf2 == NULL)
                        goto _nomem;
-               }
                buf = buf2;
        }
        if (r < 0) {