This is the mail archive of the
libc-hacker@cygnus.com
mailing list for the glibc project.
Re: A patch for fts.c
- To: "H.J. Lu" <hjl@lucon.org>, GNU C Library <libc-hacker@cygnus.com>
- Subject: Re: A patch for fts.c
- From: Richard Henderson <rth@cygnus.com>
- Date: Mon, 11 Jan 1999 21:25:36 -0800
- References: <m0zyiiC-00038dC@ocean.lucon.org>
- Reply-To: Richard Henderson <rth@cygnus.com>
> @@ -259,15 +260,18 @@ fts_close(sp)
> (void)__close(sp->fts_rfd);
> }
>
> - /* Free up the stream pointer. */
> - free(sp);
> -
> /* Set errno and return. */
> if (!ISSET(FTS_NOCHDIR) && saved_errno) {
> __set_errno (saved_errno);
> - return (-1);
> + retval = -1;
> }
> - return (0);
> + else
> + retval = 0;
> +
> + /* Free up the stream pointer. */
> + free(sp);
> +
> + return retval;
Colour me confused. How does moving the free after the if help?
It looks to me as if there was no leak to begin with.
r~