ce21efa
From 76eac44af37358fb14f437a7878119e6d34e8d7f Mon Sep 17 00:00:00 2001
ce21efa
From: Aaron Luft <aluft@lifesize.com>
ce21efa
Date: Mon, 14 Mar 2016 16:48:33 -0400
ce21efa
Subject: [PATCH 008/123] Remove the variable oldname which is attempting to
ce21efa
 free stack space.
ce21efa
ce21efa
Historically this variable hold previous value of filename that
ce21efa
had to be freed if allocated previously. Currently this branch
ce21efa
is entered only if filename was not allocated previously so it
ce21efa
became redundant. It did not cause real problems because grub_free
ce21efa
was not called, but code is confusing and causes compilation error
ce21efa
in some cases.
ce21efa
---
ce21efa
 grub-core/fs/iso9660.c | 8 ++------
ce21efa
 1 file changed, 2 insertions(+), 6 deletions(-)
ce21efa
ce21efa
diff --git a/grub-core/fs/iso9660.c b/grub-core/fs/iso9660.c
ce21efa
index 67a67cf40..c9c8374bf 100644
ce21efa
--- a/grub-core/fs/iso9660.c
ce21efa
+++ b/grub-core/fs/iso9660.c
ce21efa
@@ -750,19 +750,15 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
ce21efa
 
ce21efa
         if (dir->data->joliet && !ctx.filename)
ce21efa
           {
ce21efa
-            char *oldname, *semicolon;
ce21efa
+            char *semicolon;
ce21efa
 
ce21efa
-            oldname = name;
ce21efa
             ctx.filename = grub_iso9660_convert_string
ce21efa
-                  ((grub_uint8_t *) oldname, dirent.namelen >> 1);
ce21efa
+                  ((grub_uint8_t *) name, dirent.namelen >> 1);
ce21efa
 
ce21efa
 	    semicolon = grub_strrchr (ctx.filename, ';');
ce21efa
 	    if (semicolon)
ce21efa
 	      *semicolon = '\0';
ce21efa
 
ce21efa
-            if (ctx.filename_alloc)
ce21efa
-              grub_free (oldname);
ce21efa
-
ce21efa
             ctx.filename_alloc = 1;
ce21efa
           }
ce21efa
 
ce21efa
-- 
ce21efa
2.14.3
ce21efa