From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NUmWX-0004bF-1x for qemu-devel@nongnu.org; Tue, 12 Jan 2010 14:35:29 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NUmWS-0004VK-Ag for qemu-devel@nongnu.org; Tue, 12 Jan 2010 14:35:28 -0500 Received: from [199.232.76.173] (port=57879 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NUmWR-0004Uh-Su for qemu-devel@nongnu.org; Tue, 12 Jan 2010 14:35:24 -0500 Received: from qw-out-1920.google.com ([74.125.92.148]:5587) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NUmWQ-0003Wm-FH for qemu-devel@nongnu.org; Tue, 12 Jan 2010 14:35:22 -0500 Received: by qw-out-1920.google.com with SMTP id 14so116136qwa.4 for ; Tue, 12 Jan 2010 11:35:21 -0800 (PST) Message-ID: <4B4CCEF6.9000907@codemonkey.ws> Date: Tue, 12 Jan 2010 13:35:18 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] QMP: Don't free async event's 'data' References: <20100108164553.0ad0fb5d@doriath> In-Reply-To: <20100108164553.0ad0fb5d@doriath> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org On 01/08/2010 12:45 PM, Luiz Capitulino wrote: > 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 > Applied. Thanks. Regards, Anthony Liguori > --- > 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); >