This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] lto-wrapper.c (copy_file): Fix resource leaks
- From: Jeff Law <law at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Sylvestre Ledru <sylvestre at debian dot org>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 26 Jun 2017 09:22:31 -0600
- Subject: Re: [PATCH] lto-wrapper.c (copy_file): Fix resource leaks
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=law at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9BF1661BB2
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9BF1661BB2
- References: <8ce6151e-5784-38d0-eabb-a2fc4ae1b4da@debian.org> <757053c3-b421-4c13-bc89-3dfda4618591@redhat.com> <20170626135809.GI2123@tucnak>
On 06/26/2017 07:58 AM, Jakub Jelinek wrote:
> On Mon, May 15, 2017 at 03:58:29PM -0600, Jeff Law wrote:
>> On 05/14/2017 04:00 AM, Sylvestre Ledru wrote:
>>> Add missing fclose
>>> CID 1407987, 1407986
>>>
>>> S
>>>
>>>
>>>
>>> 0005-2017-05-14-Sylvestre-Ledru-sylvestre-debian.org.patch
>>>
>>>
>>> From d255827a64012fb81937d6baa8534eabecf9b735 Mon Sep 17 00:00:00 2001
>>> From: Sylvestre Ledru<sylvestre@debian.org>
>>> Date: Sun, 14 May 2017 11:37:37 +0200
>>> Subject: [PATCH 5/5] 2017-05-14 Sylvestre Ledru<sylvestre@debian.org>
>>>
>>> * lto-wrapper.c (copy_file): Fix resource leaks
>>> CID 1407987, 1407986
>> Doesn't this still leak in the cases were we call fatal_error?
>
> fatal_error is a noreturn function, why should we bother to do any cleanups
> after it? All that code is going to be optimized away anyway.
But cleaning this kind of thing up does help static analyzers and such.
ISTM that we'd need a compelling reason _not_ to accept this kind of patch.
jeff