]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/fs/fshelp.c (find_file): Set oldnode to zero after
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 1 Feb 2013 20:51:09 +0000 (21:51 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 1 Feb 2013 20:51:09 +0000 (21:51 +0100)
freeing it.

ChangeLog
grub-core/fs/fshelp.c

index 2e681c174c9cb0b10569e2118e08f0d0e583c843..f5396fe7937a82214491a7aaf85e498d29d17a5f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-02-01  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/fs/fshelp.c (find_file): Set oldnode to zero after
+       freeing it.
+
 2013-02-01  Vladimir Serbinenko  <phcoder@gmail.com>
 
        Implement USBDebug (full USB stack variant).
index 7e557c3fafeec692ed4f55a3533fa24596c5ae5e..11a12598c9a566cf01c590ab6bea7f8f0ef1c78f 100644 (file)
@@ -147,6 +147,7 @@ find_file (const char *currpath, grub_fshelp_node_t currroot,
              free_node (ctx->currnode, ctx);
              free_node (ctx->oldnode, ctx);
              ctx->currnode = 0;
+             ctx->oldnode = 0;
              return grub_error (GRUB_ERR_SYMLINK_LOOP,
                                 N_("too deep nesting of symlinks"));
            }
@@ -158,6 +159,7 @@ find_file (const char *currpath, grub_fshelp_node_t currroot,
          if (!symlink)
            {
              free_node (ctx->oldnode, ctx);
+             ctx->oldnode = 0;
              return grub_errno;
            }
 
@@ -177,12 +179,16 @@ find_file (const char *currpath, grub_fshelp_node_t currroot,
          if (grub_errno)
            {
              free_node (ctx->oldnode, ctx);
+             ctx->oldnode = 0;
              return grub_errno;
            }
        }
 
       if (ctx->oldnode != ctx->currnode)
-       free_node (ctx->oldnode, ctx);
+       {
+         free_node (ctx->oldnode, ctx);
+         ctx->oldnode = 0;
+       }
 
       /* Found the node!  */
       if (! next || *next == '\0')