Patchwork [06/61] pc: fix file stream leak in multiboot loader.

login
register
mail settings
Submitter Isaku Yamahata
Date Sept. 30, 2009, 10:17 a.m.
Message ID <1254305917-14784-7-git-send-email-yamahata@valinux.co.jp>
Download mbox | patch
Permalink /patch/34529/
State Superseded
Headers show

Comments

Isaku Yamahata - Sept. 30, 2009, 10:17 a.m.
fix file stream leak in load_multiboot() in pc.c
There is no reason to keep them open.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
---
 hw/pc.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/pc.c b/hw/pc.c
index bc2875e..0d85914 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -754,6 +754,7 @@  static int load_multiboot(void *fw_cfg,
                             initrd_filename, mb_mod_length);
                     exit(1);
                 }
+                fclose(f);
 
                 mb_mod_count++;
                 stl_phys(mb_mod_info + 0, mb_mod_start);