]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
fs/bfs: Fix memory leak in read_bfs_file()
authort.feng <fengtao40@huawei.com>
Tue, 29 Nov 2022 09:14:11 +0000 (17:14 +0800)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 7 Dec 2022 22:38:26 +0000 (23:38 +0100)
The l1_entries and l2_entries were not freed at the end of file read.

Fixes: 5825b3794 (BFS implementation based on the specification)
Signed-off-by: t.feng <fengtao40@huawei.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/fs/bfs.c

index a75876010d305a84be7aa8c150525df9b06973a6..07cb3e3acf35deb9f46db56aeca06e926154a803 100644 (file)
@@ -416,6 +416,8 @@ read_bfs_file (grub_disk_t disk,
        len -= read_size;
        buf = (char *) buf + read_size;
       }
+    grub_free (l1_entries);
+    grub_free (l2_entries);
     return GRUB_ERR_NONE;
   }
 }