[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <538E5249.2050305@infradead.org>
Date: Tue, 03 Jun 2014 15:55:05 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
CC: "David S. Miller" <davem@...emloft.net>,
Mathias Krause <minipli@...glemail.com>,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Documentation: connector: ucon.c: Cleaning up file resource
leak
On 05/30/2014 04:46 PM, Rickard Strandqvist wrote:
> Cleaning up a file resource leak
The return (exit) closes all open files, so there is no resource leak.
OTOH, if someone were going to add this explicit close, then it should
be added in the other exit (return) paths also.
Not applied by the Documentation maintainer.
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
> ---
> Documentation/connector/ucon.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/Documentation/connector/ucon.c b/Documentation/connector/ucon.c
> index 8a4da64..f09c6de 100644
> --- a/Documentation/connector/ucon.c
> +++ b/Documentation/connector/ucon.c
> @@ -246,5 +246,7 @@ int main(int argc, char *argv[])
> }
>
> close(s);
> + if (stdout != out)
> + fclose(out);
> return 0;
> }
>
--
~Randy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists