A patch for fts.c
Richard Henderson
rth@cygnus.com
Mon Jan 11 21:30:00 GMT 1999
> @@ -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~
More information about the Libc-hacker
mailing list