diff mbox

monitor: Plug memory leak on QMP error

Message ID 1446117309-15322-1-git-send-email-armbru@redhat.com
State New
Headers show

Commit Message

Markus Armbruster Oct. 29, 2015, 11:15 a.m. UTC
Leak introduced in commit 8a4f501..710aec9, v2.4.0.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 monitor.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Eric Blake Oct. 29, 2015, 2:31 p.m. UTC | #1
On 10/29/2015 05:15 AM, Markus Armbruster wrote:
> Leak introduced in commit 8a4f501..710aec9, v2.4.0.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  monitor.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/monitor.c b/monitor.c
> index 301a143..c59e85b 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -3862,6 +3862,7 @@ static void handle_qmp_command(JSONMessageParser *parser, QList *tokens)
>  err_out:
>      monitor_protocol_emitter(mon, data, local_err);
>      qobject_decref(data);
> +    error_free(local_err);
>      QDECREF(input);
>      QDECREF(args);
>  }
>
Luiz Capitulino Oct. 29, 2015, 3:41 p.m. UTC | #2
On Thu, 29 Oct 2015 12:15:09 +0100
Markus Armbruster <armbru@redhat.com> wrote:

> Leak introduced in commit 8a4f501..710aec9, v2.4.0.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>

I think this can go through your tree?

> ---
>  monitor.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/monitor.c b/monitor.c
> index 301a143..c59e85b 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -3862,6 +3862,7 @@ static void handle_qmp_command(JSONMessageParser *parser, QList *tokens)
>  err_out:
>      monitor_protocol_emitter(mon, data, local_err);
>      qobject_decref(data);
> +    error_free(local_err);
>      QDECREF(input);
>      QDECREF(args);
>  }
Markus Armbruster Oct. 29, 2015, 4:23 p.m. UTC | #3
Luiz Capitulino <lcapitulino@redhat.com> writes:

> On Thu, 29 Oct 2015 12:15:09 +0100
> Markus Armbruster <armbru@redhat.com> wrote:
>
>> Leak introduced in commit 8a4f501..710aec9, v2.4.0.
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>
> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>

Thanks!

> I think this can go through your tree?

Yes, along with the json-streamer work.
Luiz Capitulino Oct. 29, 2015, 7:06 p.m. UTC | #4
On Thu, 29 Oct 2015 17:23:43 +0100
Markus Armbruster <armbru@redhat.com> wrote:

> Luiz Capitulino <lcapitulino@redhat.com> writes:
> 
> > On Thu, 29 Oct 2015 12:15:09 +0100
> > Markus Armbruster <armbru@redhat.com> wrote:
> >
> >> Leak introduced in commit 8a4f501..710aec9, v2.4.0.
> >> 
> >> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> >
> > Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
> 
> Thanks!
> 
> > I think this can go through your tree?
> 
> Yes, along with the json-streamer work.

Do you need my review for that one? It's been ages that I don't
look at that code, I'm not sure it's going to be that worthwhile.
Markus Armbruster Oct. 30, 2015, 7:35 a.m. UTC | #5
Luiz Capitulino <lcapitulino@redhat.com> writes:

> On Thu, 29 Oct 2015 17:23:43 +0100
> Markus Armbruster <armbru@redhat.com> wrote:
>
>> Luiz Capitulino <lcapitulino@redhat.com> writes:
>> 
>> > On Thu, 29 Oct 2015 12:15:09 +0100
>> > Markus Armbruster <armbru@redhat.com> wrote:
>> >
>> >> Leak introduced in commit 8a4f501..710aec9, v2.4.0.
>> >> 
>> >> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> >
>> > Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
>> 
>> Thanks!
>> 
>> > I think this can go through your tree?
>> 
>> Yes, along with the json-streamer work.
>
> Do you need my review for that one? It's been ages that I don't
> look at that code, I'm not sure it's going to be that worthwhile.

Review is always welcome, but "need" is too strong.  qobject/json* isn't
your code anyway, and I got Eric's review already.
diff mbox

Patch

diff --git a/monitor.c b/monitor.c
index 301a143..c59e85b 100644
--- a/monitor.c
+++ b/monitor.c
@@ -3862,6 +3862,7 @@  static void handle_qmp_command(JSONMessageParser *parser, QList *tokens)
 err_out:
     monitor_protocol_emitter(mon, data, local_err);
     qobject_decref(data);
+    error_free(local_err);
     QDECREF(input);
     QDECREF(args);
 }