On Wed, Dec 09, 2009 at 07:35:26PM -0500, Brad Tilley wrote:
> Not sure this is an acceptable patch. Certainly not required, but
> maybe good practice?
>
> # cvs diff -Nup finger.c
> Index: finger.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/finger/finger.c,v
> retrieving revision 1.18
> diff -N -u -p finger.c
> --- finger.c 12 Nov 2009 15:33:21 -0000 1.18
> +++ finger.c 10 Dec 2009 00:33:02 -0000
> @@ -246,6 +246,8 @@ net: for (pn = nethead; pn; pn = pn->next) {
> }
>
> free(used);
> + used = NULL;
> +
> if (entries == 0)
> return;
The var 'used' is local and not used after the free(3), so it's indeed
not needed. I also do not think this is good practise. Assignments for
which it is easy to see that they are redundant are just extra lines
without any benefit.
-Otto