]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Fix memory leak.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 16 Nov 2004 20:44:34 +0000 (20:44 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 16 Nov 2004 20:44:34 +0000 (20:44 +0000)
src/pinky.c
src/who.c

index 2e97fc8a66bfff716de955c35bde548edeb5b086..6912972fc3b2c5b9e6952d86213059554eeaa974 100644 (file)
@@ -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
 
index 714ac28402ae2a460c3686243c08b46bfc77e3b5..d050dc1fc942b982fad08bb5556f53d2babb0ecc 100644 (file)
--- 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
     {