bug-coreutils
[Top][All Lists]
Advanced

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

Re: PATCH: memleak in users.c


From: Jim Meyering
Subject: Re: PATCH: memleak in users.c
Date: Wed, 05 Nov 2003 04:19:05 +0100

Dennis Smit <address@hidden> wrote:
...
> there is memory allocated within the read_utmp function for
> utmp_buf:
>   int fail = read_utmp (filename, &n_users, &utmp_buf);
>
> which is never being freed.
>
> This is solved by the following patch:
> ------------------
> --- users.c     2003-10-30 03:11:09.000000000 +0100
> +++ usersnew.c  2003-10-30 03:09:36.000000000 +0100
> @@ -104,6 +104,8 @@
>      error (EXIT_FAILURE, errno, "%s", filename);
>
>    list_entries_users (n_users, utmp_buf);
> +
> +  free (utmp_buf);
>  }
>
>  void

Thank you for that patch.
I've applied it, even though technically the explicit free is
unnecessary here.




reply via email to

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