From: Paul Eggert Date: Tue, 16 Nov 2004 20:44:34 +0000 (+0000) Subject: Fix memory leak. X-Git-Tag: v5.3.0~387 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed2fcc6f9aa466b2e026af88fd3bd712e007da25;p=thirdparty%2Fcoreutils.git Fix memory leak. --- diff --git a/src/pinky.c b/src/pinky.c index 2e97fc8a66..6912972fc3 100644 --- a/src/pinky.c +++ b/src/pinky.c @@ -310,6 +310,9 @@ print_entry (const STRUCT_UTMP *utmp_ent) printf (" %s:%s", host, display); else printf (" %s", host); + + if (host != ut_host) + free (host); } #endif diff --git a/src/who.c b/src/who.c index 714ac28402..d050dc1fc9 100644 --- a/src/who.c +++ b/src/who.c @@ -421,6 +421,9 @@ print_user (const STRUCT_UTMP *utmp_ent, time_t boottime) } sprintf (hoststr, "(%s)", host); } + + if (host != ut_host) + free (host); } else {