lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <50F4AE6E.6080103@gmail.com>
Date:	Mon, 14 Jan 2013 17:18:38 -0800
From:	David Daney <ddaney.cavm@...il.com>
To:	Cong Ding <dinggnu@...il.com>
CC:	"H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
	Matt Fleming <matt.fleming@...el.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86: boot/compressed/mkpiggy.c: fix resource leakage

On 01/14/2013 10:14 AM, Cong Ding wrote:
> the file should be closed if it goes to error.
>

What tool are you using to generate all these patches?


> Signed-off-by: Cong Ding <dinggnu@...il.com>
> ---
>   arch/x86/boot/compressed/mkpiggy.c |    1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/arch/x86/boot/compressed/mkpiggy.c b/arch/x86/boot/compressed/mkpiggy.c
> index 958a641..e29154f 100644
> --- a/arch/x86/boot/compressed/mkpiggy.c
> +++ b/arch/x86/boot/compressed/mkpiggy.c
> @@ -58,6 +58,7 @@ int main(int argc, char *argv[])
>
>   	if (fread(&olen, sizeof(olen), 1, f) != 1) {
>   		perror(argv[1]);
> +		fclose(f);

The next line is a return from main().  All FILEs will be automatically 
closed by the C library, so your change is redundant.

The x86 maintainers can do what ever they want with it.  But to me, it 
seems like unnecessary code churn.

David Daney

>   		return 1;
>   	}
>
>

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ