GNU bug report logs - #31439
Possible memory leak in fts.c

Previous Next

Package: coreutils;

Reported by: isedev <at> gmail.com

Date: Sun, 13 May 2018 08:33:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #16 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kamil Dudka <kdudka <at> redhat.com>
To: Pádraig Brady <P <at> draigbrady.com>
Cc: isedev <at> gmail.com, bug-gnulib <bug-gnulib <at> gnu.org>, bug-coreutils <at> gnu.org,
 31439-done <at> debbugs.gnu.org
Subject: Re: bug#31439: [PATCH] fts: avoid a memory leak edge case
Date: Mon, 14 May 2018 10:06:53 +0200
On Monday, May 14, 2018 3:51:02 AM CEST Pádraig Brady wrote:
> @@ -122,9 +139,10 @@ main (void)
>      perror_exit (base, 6);
>    while ((e = fts_read (ftsp)))
>      needles_seen += strcmp (e->fts_name, "needle") == 0;
> -  fflush (stdout);
>    if (errno)
>      perror_exit ("fts_read", 7);
> +  if (fts_close (ftsp) != 0)
> +    perror_exit (base, 8);
>  
>    /* Report an error if we did not find the needles.  */
>    if (needles_seen != needles)

Why are you removing fflush (stdout) from the test without any explanation?

Kamil






This bug report was last modified 7 years and 7 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.