]> git.ipfire.org Git - thirdparty/grub.git/commit
loader/xnu: Fix memory leak
authorLidong Chen <lidong.chen@oracle.com>
Thu, 27 Mar 2025 17:56:35 +0000 (17:56 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Fri, 4 Apr 2025 17:37:34 +0000 (19:37 +0200)
commit6b64f297e5906feb295dcc6fb5046368f5f3e95b
treefa696025974fd10258c434ac7559ab1c946136b6
parentf94d257e8c983e6c3f4a7f5ce8a45f5cd7299f04
loader/xnu: Fix memory leak

In grub_xnu_load_kext_from_dir(), when the call to grub_device_open()
failed, it simply cleaned up previously allocated memory and returned
GRUB_ERR_NONE. However, it neglected to free ctx->newdirname which is
allocated before the call to grub_device_open().

Fixes: CID 473859
Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/loader/xnu.c