]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
last: fix memory leak
authorSami Kerola <kerolasa@iki.fi>
Sun, 8 Sep 2013 16:09:06 +0000 (17:09 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 10 Sep 2013 10:57:31 +0000 (12:57 +0200)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
login-utils/last.c

index eb64bde6a82894612012272d17244063ac202006..bc1b4ce0d9b14fa7ebac8e4bbeae36820aac5a88 100644 (file)
@@ -819,6 +819,10 @@ static void process_wtmp_file(const struct last_control *ctl)
 
        printf(_("\n%s begins %s"), basename(ctl->altv[ctl->alti]), ctime(&begintime));
        fclose(fp);
+       for (p = utmplist; p; p = next) {
+               next = p->next;
+               free(p);
+       }
 }
 
 int main(int argc, char **argv)