Blame SOURCES/0217-chainloader-fix-resoource-leak.patch

f731ee
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
f731ee
From: Andrei Borzenkov <arvidjaar@gmail.com>
f731ee
Date: Fri, 26 Jun 2015 09:25:30 +0300
f731ee
Subject: [PATCH] chainloader: fix resoource leak
f731ee
f731ee
Found by: Coverity scan.
f731ee
CID: 96651
f731ee
---
f731ee
 grub-core/loader/efi/chainloader.c | 6 +++---
f731ee
 1 file changed, 3 insertions(+), 3 deletions(-)
f731ee
f731ee
diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c
f731ee
index ec23cf4ed66..522a716e37d 100644
f731ee
--- a/grub-core/loader/efi/chainloader.c
f731ee
+++ b/grub-core/loader/efi/chainloader.c
f731ee
@@ -350,9 +350,6 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
f731ee
     }
f731ee
   loaded_image->device_handle = dev_handle;
f731ee
 
f731ee
-  grub_file_close (file);
f731ee
-  file = NULL;
f731ee
-
f731ee
   if (argc > 1)
f731ee
     {
f731ee
       int i, len;
f731ee
@@ -382,6 +379,9 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
f731ee
       loaded_image->load_options_size = len;
f731ee
     }
f731ee
 
f731ee
+  grub_file_close (file);
f731ee
+  grub_device_close (dev);
f731ee
+
f731ee
   grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0);
f731ee
   return 0;
f731ee