]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
fs/btrfs: Fix memory leak in find_path()
authort.feng <fengtao40@huawei.com>
Tue, 29 Nov 2022 09:14:08 +0000 (17:14 +0800)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 7 Dec 2022 22:38:25 +0000 (23:38 +0100)
Fixes: 82591fa6e (Make / in btrfs refer to real root)
Signed-off-by: t.feng <fengtao40@huawei.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/fs/btrfs.c

index ec72f7be36d90e0f72215cbfa871160f045ffe68..19bff4610246bf45a58337899a8d1443400fdde4 100644 (file)
@@ -1982,7 +1982,12 @@ find_path (struct grub_btrfs_data *data,
            {
              err = get_root (data, key, tree, type);
              if (err)
-               return err;
+               {
+                 grub_free (direl);
+                 grub_free (path_alloc);
+                 grub_free (origpath);
+                 return err;
+               }
            }
          continue;
        }