From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NTJqY-0004da-8V for qemu-devel@nongnu.org; Fri, 08 Jan 2010 13:46:06 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NTJqT-0004WD-9q for qemu-devel@nongnu.org; Fri, 08 Jan 2010 13:46:05 -0500 Received: from [199.232.76.173] (port=54469 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTJqS-0004Vl-VM for qemu-devel@nongnu.org; Fri, 08 Jan 2010 13:46:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:63813) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NTJqS-0000P4-6t for qemu-devel@nongnu.org; Fri, 08 Jan 2010 13:46:00 -0500 Date: Fri, 8 Jan 2010 16:45:53 -0200 From: Luiz Capitulino Message-ID: <20100108164553.0ad0fb5d@doriath> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] QMP: Don't free async event's 'data' List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com 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 --- monitor.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/monitor.c b/monitor.c index 3af1d5c..2403a97 100644 --- 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); -- 1.6.6