mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
QMP: Don't free async event's 'data'
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>
This commit is contained in:
parent
514d97dea6
commit
3d72f9a2be
1 changed files with 3 additions and 1 deletions
|
|
@ -365,8 +365,10 @@ void monitor_protocol_event(MonitorEvent event, QObject *data)
|
||||||
qmp = qdict_new();
|
qmp = qdict_new();
|
||||||
timestamp_put(qmp);
|
timestamp_put(qmp);
|
||||||
qdict_put(qmp, "event", qstring_from_str(event_name));
|
qdict_put(qmp, "event", qstring_from_str(event_name));
|
||||||
if (data)
|
if (data) {
|
||||||
|
qobject_incref(data);
|
||||||
qdict_put_obj(qmp, "data", data);
|
qdict_put_obj(qmp, "data", data);
|
||||||
|
}
|
||||||
|
|
||||||
monitor_json_emitter(mon, QOBJECT(qmp));
|
monitor_json_emitter(mon, QOBJECT(qmp));
|
||||||
QDECREF(qmp);
|
QDECREF(qmp);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue