bug-coreutils
[Top][All Lists]
Advanced

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

patch for memory leaks in pinky, who


From: Paul Eggert
Subject: patch for memory leaks in pinky, who
Date: Tue, 16 Nov 2004 12:44:41 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

I installed this obvious patch:

2004-11-16  Paul Eggert  <address@hidden>

        * src/pinky.c (print_entry): Fix memory leak.
        * src/who.c (print_user): Likewise.

Index: src/pinky.c
===================================================================
RCS file: /fetish/cu/src/pinky.c,v
retrieving revision 1.42
diff -p -u -r1.42 pinky.c
--- src/pinky.c 21 Sep 2004 22:26:42 -0000      1.42
+++ src/pinky.c 16 Nov 2004 20:27:50 -0000
@@ -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: src/who.c
===================================================================
RCS file: /fetish/cu/src/who.c,v
retrieving revision 1.103
diff -p -u -r1.103 who.c
--- src/who.c   21 Sep 2004 22:26:42 -0000      1.103
+++ src/who.c   16 Nov 2004 20:27:52 -0000
@@ -421,6 +421,9 @@ print_user (const STRUCT_UTMP *utmp_ent,
            }
          sprintf (hoststr, "(%s)", host);
        }
+
+      if (host != ut_host)
+       free (host);
     }
   else
     {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]