]> git.ipfire.org Git - thirdparty/grub.git/commit
loader/i386/pc/linux: Fix resource leak
authorLidong Chen <lidong.chen@oracle.com>
Mon, 23 Jun 2025 17:46:01 +0000 (17:46 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 26 Jun 2025 18:02:05 +0000 (20:02 +0200)
commita68a7dece464c35b1c8d20b98502b6881b103911
tree083e6b3f9923c71abeceaa4f13c13501b8e8b203
parentde80acf3684d8440937a5beb6270579f6893fee4
loader/i386/pc/linux: Fix resource leak

In grub_cmd_initrd(), memory is allocated for variable initrd_ctx
before calling grub_relocator_alloc_chunk_align_safe(). When the
function call fails, initrd_ctx should be freed before exiting
grub_cmd_initrd().

Fixes: CID 473852
Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
Reviewed-by: Sudhakar Kuppusamy <sudhakar@linux.ibm.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/loader/i386/pc/linux.c