mirror of
https://github.com/qemu/qemu.git
synced 2025-08-09 01:50:43 +00:00
hmp: Guard against misuse of hmp_handle_error()
Null errp argument makes no sense. Assert it's not null, to make this explicit, and guard against misuse. All current callers pass non-null errp. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
a903f40c31
commit
415168e0c7
3
hmp.c
3
hmp.c
@ -28,7 +28,8 @@
|
|||||||
|
|
||||||
static void hmp_handle_error(Monitor *mon, Error **errp)
|
static void hmp_handle_error(Monitor *mon, Error **errp)
|
||||||
{
|
{
|
||||||
if (error_is_set(errp)) {
|
assert(errp);
|
||||||
|
if (*errp) {
|
||||||
monitor_printf(mon, "%s\n", error_get_pretty(*errp));
|
monitor_printf(mon, "%s\n", error_get_pretty(*errp));
|
||||||
error_free(*errp);
|
error_free(*errp);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user