]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Remove the variable oldname which is attempting to free stack space.
authorAaron Luft <aluft@lifesize.com>
Mon, 14 Mar 2016 20:48:33 +0000 (16:48 -0400)
committerAndrei Borzenkov <arvidjaar@gmail.com>
Tue, 15 Mar 2016 19:04:38 +0000 (22:04 +0300)
Historically this variable hold previous value of filename that
had to be freed if allocated previously. Currently this branch
is entered only if filename was not allocated previously so it
became redundant. It did not cause real problems because grub_free
was not called, but code is confusing and causes compilation error
in some cases.

grub-core/fs/iso9660.c

index 67a67cf40dae4c00355bc4e93d32d449c45ff4c2..c9c8374bf614b4e39b5e57fd813e4e587e256679 100644 (file)
@@ -750,19 +750,15 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
 
         if (dir->data->joliet && !ctx.filename)
           {
-            char *oldname, *semicolon;
+            char *semicolon;
 
-            oldname = name;
             ctx.filename = grub_iso9660_convert_string
-                  ((grub_uint8_t *) oldname, dirent.namelen >> 1);
+                  ((grub_uint8_t *) name, dirent.namelen >> 1);
 
            semicolon = grub_strrchr (ctx.filename, ';');
            if (semicolon)
              *semicolon = '\0';
 
-            if (ctx.filename_alloc)
-              grub_free (oldname);
-
             ctx.filename_alloc = 1;
           }