xen: avoid memleaks on error

When loading a Xen pv-kernel avoid memory leaks in case of errors.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Juergen Gross 2016-03-03 10:38:07 +01:00 committed by Daniel Kiper
parent 4231927e44
commit c69d1858f1
2 changed files with 14 additions and 7 deletions

View file

@ -563,7 +563,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
{
err = grub_relocator_alloc_chunk_addr (relocator, &ch, max_addr, size);
if (err)
return err;
goto fail;
if (grub_initrd_load (&initrd_ctx, argv,
get_virtual_current_address (ch)))