]> git.ipfire.org Git - thirdparty/grub.git/commit
loader/xnu: Fix memory leak
authorDarren Kenny <darren.kenny@oracle.com>
Thu, 26 Nov 2020 12:53:10 +0000 (12:53 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 2 Mar 2021 14:54:17 +0000 (15:54 +0100)
commitbcb59ece3263d118510c4440c4da0950f224bb7f
treec55e6d807c2fbe1d0b9ba6dc7b5762cfe1ff1852
parent5d5391b0a05abe76e04c1eb68dcc6cbef5326c4a
loader/xnu: Fix memory leak

The code here is finished with the memory stored in name, but it only
frees it if there curvalue is valid, while it could actually free it
regardless.

The fix is a simple relocation of the grub_free() to before the test
of curvalue.

Fixes: CID 96646
Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/loader/xnu.c