loader/i386/linux: Fix resource leak
In grub_cmd_initrd(), initrd_ctx is allocated before calling grub_relocator_alloc_chunk_align(). When that function 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: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
parent
1d00594475
commit
81146fb623
@ -1128,7 +1128,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
||||
GRUB_RELOCATOR_PREFERENCE_HIGH,
|
||||
1);
|
||||
if (err)
|
||||
return err;
|
||||
goto fail;
|
||||
initrd_mem = get_virtual_current_address (ch);
|
||||
initrd_mem_target = get_physical_target_address (ch);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user