Blame SOURCES/0124-util-grub-mkimage.c-main-Postpone-freeing-arguments..patch

f96e0b
From d47a9c22d29f5237a0ecf981c70e55bb9c6a73c6 Mon Sep 17 00:00:00 2001
f96e0b
From: Leif Lindholm <leif.lindholm@arm.com>
f96e0b
Date: Sun, 20 Jan 2013 23:16:34 +0000
f96e0b
Subject: [PATCH 124/482] * util/grub-mkimage.c (main): Postpone freeing
f96e0b
 arguments.output until after its use in generate_image.
f96e0b
f96e0b
---
f96e0b
 ChangeLog           | 5 +++++
f96e0b
 util/grub-mkimage.c | 4 +++-
f96e0b
 2 files changed, 8 insertions(+), 1 deletion(-)
f96e0b
f96e0b
diff --git a/ChangeLog b/ChangeLog
f96e0b
index 6886f29..10c094b 100644
f96e0b
--- a/ChangeLog
f96e0b
+++ b/ChangeLog
f96e0b
@@ -1,3 +1,8 @@
f96e0b
+2013-01-20  Leif Lindholm  <leif.lindholm@arm.com>
f96e0b
+
f96e0b
+	* util/grub-mkimage.c (main): Postpone freeing arguments.output
f96e0b
+	until after its use in generate_image.
f96e0b
+
f96e0b
 2013-01-20  Colin Watson  <cjwatson@ubuntu.com>
f96e0b
 
f96e0b
 	* grub-core/loader/i386/linux.c (grub_cmd_initrd): Don't add the
f96e0b
diff --git a/util/grub-mkimage.c b/util/grub-mkimage.c
f96e0b
index d0eecf2..29bda17 100644
f96e0b
--- a/util/grub-mkimage.c
f96e0b
+++ b/util/grub-mkimage.c
f96e0b
@@ -1905,7 +1905,6 @@ main (int argc, char *argv[])
f96e0b
       if (! fp)
f96e0b
 	grub_util_error (_("cannot open `%s': %s"), arguments.output,
f96e0b
 			 strerror (errno));
f96e0b
-      free (arguments.output);
f96e0b
     }
f96e0b
 
f96e0b
   if (!arguments.dir)
f96e0b
@@ -1933,5 +1932,8 @@ main (int argc, char *argv[])
f96e0b
   if (arguments.dir)
f96e0b
     free (arguments.dir);
f96e0b
 
f96e0b
+  if (arguments.output)
f96e0b
+    free (arguments.output);
f96e0b
+
f96e0b
   return 0;
f96e0b
 }
f96e0b
-- 
f96e0b
1.8.2.1
f96e0b