All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] QMP: Don't free async event's 'data'
@ 2010-01-08 18:45 Luiz Capitulino
  2010-01-12 19:35 ` Anthony Liguori
  0 siblings, 1 reply; 2+ messages in thread
From: Luiz Capitulino @ 2010-01-08 18:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: aliguori


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>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] QMP: Don't free async event's 'data'
  2010-01-08 18:45 [Qemu-devel] [PATCH] QMP: Don't free async event's 'data' Luiz Capitulino
@ 2010-01-12 19:35 ` Anthony Liguori
  0 siblings, 0 replies; 2+ messages in thread
From: Anthony Liguori @ 2010-01-12 19:35 UTC (permalink / raw)
  To: Luiz Capitulino; +Cc: aliguori, qemu-devel

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<lcapitulino@redhat.com>
>    

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);
>    

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-12 19:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-08 18:45 [Qemu-devel] [PATCH] QMP: Don't free async event's 'data' Luiz Capitulino
2010-01-12 19:35 ` Anthony Liguori

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.