Commit 415168e0 authored by Markus Armbruster's avatar Markus Armbruster Committed by Luiz Capitulino
Browse files

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: default avatarMarkus Armbruster <armbru@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Signed-off-by: default avatarLuiz Capitulino <lcapitulino@redhat.com>
parent a903f40c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -28,7 +28,8 @@

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));
        error_free(*errp);
    }