[PATCH 1/4] last: fix memory leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 login-utils/last.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/login-utils/last.c b/login-utils/last.c
index eb64bde..bc1b4ce 100644
--- a/login-utils/last.c
+++ b/login-utils/last.c
@@ -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)
-- 
1.8.4

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux