From: t.feng Date: Tue, 29 Nov 2022 09:14:11 +0000 (+0800) Subject: fs/bfs: Fix memory leak in read_bfs_file() X-Git-Tag: grub-2.12-rc1~200 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cdd08b3626a5f81d44250dbbe7c078c0bd6f47f;p=thirdparty%2Fgrub.git fs/bfs: Fix memory leak in read_bfs_file() 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 Reviewed-by: Daniel Kiper --- diff --git a/grub-core/fs/bfs.c b/grub-core/fs/bfs.c index a75876010..07cb3e3ac 100644 --- a/grub-core/fs/bfs.c +++ b/grub-core/fs/bfs.c @@ -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; } }