monitor: fix double-free of request error

qmp_error_response() will free the given error. Fix double-free in
later qmp_request_free().

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20180705164201.9853-1-marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Fixes: 1cc3747152
Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
Marc-André Lureau 2018-07-05 18:42:01 +02:00 committed by Markus Armbruster
parent c447afd578
commit 42eab8dbec

View File

@ -4186,6 +4186,7 @@ static void monitor_qmp_bh_dispatcher(void *data)
} else {
assert(req_obj->err);
rsp = qmp_error_response(req_obj->err);
req_obj->err = NULL;
monitor_qmp_respond(req_obj->mon, rsp, NULL);
qobject_unref(rsp);
}