]> git.proxmox.com Git - qemu.git/commitdiff
QMP: Don't free async event's 'data'
authorLuiz Capitulino <lcapitulino@redhat.com>
Fri, 8 Jan 2010 18:45:53 +0000 (16:45 -0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 12 Jan 2010 19:24:52 +0000 (13:24 -0600)
The monitor_protocol_event() function will free the
event's data, this is wrong as 'data' management is up
to the caller.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
monitor.c

index 3af1d5c782969a2ea7338e0b56fbad481b5392fd..2403a979e409574d9bd3abf1d0c6b041e0b509ba 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -365,8 +365,10 @@ void monitor_protocol_event(MonitorEvent event, QObject *data)
     qmp = qdict_new();
     timestamp_put(qmp);
     qdict_put(qmp, "event", qstring_from_str(event_name));
-    if (data)
+    if (data) {
+        qobject_incref(data);
         qdict_put_obj(qmp, "data", data);
+    }
 
     monitor_json_emitter(mon, QOBJECT(qmp));
     QDECREF(qmp);