OSDN Git Service

alsactl: simple coverity fix
authorJaroslav Kysela <perex@perex.cz>
Tue, 12 Mar 2019 15:05:23 +0000 (16:05 +0100)
committerJaroslav Kysela <perex@perex.cz>
Tue, 12 Mar 2019 15:05:48 +0000 (16:05 +0100)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
alsactl/init_parse.c

index f39d80e..562e674 100644 (file)
@@ -1675,8 +1675,10 @@ static int parse(struct space *space, const char *filename)
        linenum = 0;
        linesize = 128;
        line = malloc(linesize);
-       if (line == NULL)
+       if (line == NULL) {
+               file_unmap(buf, bufsize);
                return -ENOMEM;
+       }
        space->filename = filename;
        while (!err && pos < bufsize && !space->quit) {
                count = line_width(buf, bufsize, pos);