lkml.org 
[lkml]   [2013]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] x86: boot/compressed/mkpiggy.c: fix resource leakage
Date
the file should be closed if it goes to error.

Signed-off-by: Cong Ding <dinggnu@gmail.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);
return 1;
}

--
1.7.9.5


\
 
 \ /
  Last update: 2013-01-14 20:01    [W:0.029 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site