diff mbox

hmp: fix memory leak at hmp_info_block_jobs()

Message ID 1410874615-14292-1-git-send-email-arei.gonglei@huawei.com
State New
Headers show

Commit Message

Gonglei (Arei) Sept. 16, 2014, 1:36 p.m. UTC
From: Gonglei <arei.gonglei@huawei.com>

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 hmp.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Markus Armbruster Sept. 16, 2014, 3:11 p.m. UTC | #1
<arei.gonglei@huawei.com> writes:

> From: Gonglei <arei.gonglei@huawei.com>
>
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> ---
>  hmp.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/hmp.c b/hmp.c
> index 40a90da..31fb6a1 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -679,6 +679,8 @@ void hmp_info_block_jobs(Monitor *mon, const QDict *qdict)
>          }
>          list = list->next;
>      }
> +
> +    qapi_free_BlockJobInfoList(list);
>  }
>  
>  void hmp_info_tpm(Monitor *mon, const QDict *qdict)

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Gonglei (Arei) Sept. 17, 2014, 1:04 a.m. UTC | #2
> From: Markus Armbruster [mailto:armbru@redhat.com]
> Sent: Tuesday, September 16, 2014 11:12 PM
> To: Gonglei (Arei)
> Cc: qemu-devel@nongnu.org; kwolf@redhat.com; Huangweidong (C);
> lcapitulino@redhat.com; stefanha@redhat.com
> Subject: Re: [Qemu-devel] [PATCH] hmp: fix memory leak at
> hmp_info_block_jobs()
> 
> <arei.gonglei@huawei.com> writes:
> 
> > From: Gonglei <arei.gonglei@huawei.com>
> >
> > Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> > ---
> >  hmp.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/hmp.c b/hmp.c
> > index 40a90da..31fb6a1 100644
> > --- a/hmp.c
> > +++ b/hmp.c
> > @@ -679,6 +679,8 @@ void hmp_info_block_jobs(Monitor *mon, const
> QDict *qdict)
> >          }
> >          list = list->next;
> >      }
> > +
> > +    qapi_free_BlockJobInfoList(list);
> >  }
> >
> >  void hmp_info_tpm(Monitor *mon, const QDict *qdict)
> 
> Reviewed-by: Markus Armbruster <armbru@redhat.com>

Thanks for review. :)

Best regards,
-Gonglei
Stefan Hajnoczi Sept. 17, 2014, 1:02 p.m. UTC | #3
On Tue, Sep 16, 2014 at 09:36:55PM +0800, arei.gonglei@huawei.com wrote:
> From: Gonglei <arei.gonglei@huawei.com>
> 
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> ---
>  hmp.c | 2 ++
>  1 file changed, 2 insertions(+)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan
diff mbox

Patch

diff --git a/hmp.c b/hmp.c
index 40a90da..31fb6a1 100644
--- a/hmp.c
+++ b/hmp.c
@@ -679,6 +679,8 @@  void hmp_info_block_jobs(Monitor *mon, const QDict *qdict)
         }
         list = list->next;
     }
+
+    qapi_free_BlockJobInfoList(list);
 }
 
 void hmp_info_tpm(Monitor *mon, const QDict *qdict)