[PULL,1/1] monitor: fix double-free of request error

Message ID 20180711191408.2438-2-armbru@redhat.com
State New
Headers show
Series
  • [PULL,1/1] monitor: fix double-free of request error
Related show

Commit Message

Markus Armbruster July 11, 2018, 7:14 p.m.
From: Marc-André Lureau <marcandre.lureau@redhat.com>

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: 1cc37471525d03f963bc71d724f0dc9eab888fc1
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 monitor.c | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/monitor.c b/monitor.c
index 3c9c97b73f..7af1f18d13 100644
--- a/monitor.c
+++ b/monitor.c
@@ -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);
     }