Subject: bug#31439: [PATCH] fts: avoid a memory leak edge case

From: Kamil Dudka <[email-masked]>
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