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:
Stephen J. Kiernan 2017-06-02 20:25:25 +00:00
parent 6a1c2e1fce
commit e2005cef7f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=319508

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);