]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lslogins: free after error [coverity scan]
authorKarel Zak <kzak@redhat.com>
Fri, 26 Sep 2014 09:25:24 +0000 (11:25 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 26 Sep 2014 09:25:24 +0000 (11:25 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/readutmp.c

index 4e8a0845ce3007a471a5fadb30d9219a4f146aef..b11e9a4d2ae7b35158e2002292e7d62355766b00 100644 (file)
@@ -64,8 +64,10 @@ read_utmp (char const *file, size_t *n_entries, struct utmp **utmp_buf)
                }
                utmp[n_read++] = *u;
        }
-       if (!u && errno)
+       if (!u && errno) {
+               free(utmp);
                return -1;
+       }
 
        endutent();