commands/parttool: fix memory leak.
Found by: Coverity scan.
This commit is contained in:
parent
e871994849
commit
3db4f05a10
1 changed files with 4 additions and 1 deletions
|
@ -282,8 +282,11 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (! cur)
|
if (! cur)
|
||||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("unknown argument `%s'"),
|
{
|
||||||
|
grub_device_close (dev);
|
||||||
|
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("unknown argument `%s'"),
|
||||||
args[i]);
|
args[i]);
|
||||||
|
}
|
||||||
ptool = cur;
|
ptool = cur;
|
||||||
pargs = (struct grub_parttool_args *)
|
pargs = (struct grub_parttool_args *)
|
||||||
grub_zalloc (ptool->nargs * sizeof (struct grub_parttool_args));
|
grub_zalloc (ptool->nargs * sizeof (struct grub_parttool_args));
|
||||||
|
|
Loading…
Reference in a new issue