Fix a memory leak with last

free memory allocated to 'buf'

Submitted by:	Thomas Rix <trix@juniper.net>
Reviewed by:	ed
Approved by:	sjg (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D9850
This commit is contained in:
stevek 2017-06-02 20:25:25 +00:00
parent 304b0a16bb
commit 442a984788

View File

@ -243,7 +243,7 @@ wtmp(void)
/* Display them in reverse order. */
while (amount > 0)
doentry(&buf[--amount]);
free(buf);
tm = localtime(&t);
(void) strftime(ct, sizeof(ct), "%+", tm);
printf("\n%s begins %s\n", ((file == NULL) ? "utx.log" : file), ct);