mirror of
https://git.proxmox.com/git/grub2
synced 2025-07-26 22:05:11 +00:00
search_wrap: fix memory leak
Found by: Coverity scan. CID: 96675
This commit is contained in:
parent
2f01f08103
commit
5af859bb77
@ -175,7 +175,10 @@ grub_cmd_search (grub_extcmd_context_t ctxt, int argc, char **args)
|
|||||||
var = "root";
|
var = "root";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
|
{
|
||||||
|
grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
if (state[SEARCH_LABEL].set)
|
if (state[SEARCH_LABEL].set)
|
||||||
grub_search_label (id, var, state[SEARCH_NO_FLOPPY].set,
|
grub_search_label (id, var, state[SEARCH_NO_FLOPPY].set,
|
||||||
@ -187,8 +190,10 @@ grub_cmd_search (grub_extcmd_context_t ctxt, int argc, char **args)
|
|||||||
grub_search_fs_file (id, var, state[SEARCH_NO_FLOPPY].set,
|
grub_search_fs_file (id, var, state[SEARCH_NO_FLOPPY].set,
|
||||||
hints, nhints);
|
hints, nhints);
|
||||||
else
|
else
|
||||||
return grub_error (GRUB_ERR_INVALID_COMMAND, "unspecified search type");
|
grub_error (GRUB_ERR_INVALID_COMMAND, "unspecified search type");
|
||||||
|
|
||||||
|
out:
|
||||||
|
grub_free (hints);
|
||||||
return grub_errno;
|
return grub_errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user