qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: Fix memory leak in hmp_drive_add_node()
@ 2016-03-16 10:16 Kevin Wolf
  2016-03-16 12:26 ` Markus Armbruster
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Wolf @ 2016-03-16 10:16 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, qemu-devel

hmp_drive_add_node() leaked qdict in the error path when no node-name is
specified.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 blockdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/blockdev.c b/blockdev.c
index e7b8676..50410bf 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -3898,6 +3898,7 @@ void hmp_drive_add_node(Monitor *mon, const char *optstr)
     qdict = qemu_opts_to_qdict(opts, NULL);
 
     if (!qdict_get_try_str(qdict, "node-name")) {
+        QDECREF(qdict);
         error_report("'node-name' needs to be specified");
         goto out;
     }
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PATCH] block: Fix memory leak in hmp_drive_add_node()
  2016-03-16 10:16 [Qemu-devel] [PATCH] block: Fix memory leak in hmp_drive_add_node() Kevin Wolf
@ 2016-03-16 12:26 ` Markus Armbruster
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Armbruster @ 2016-03-16 12:26 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel, qemu-block

Kevin Wolf <kwolf@redhat.com> writes:

> hmp_drive_add_node() leaked qdict in the error path when no node-name is
> specified.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  blockdev.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/blockdev.c b/blockdev.c
> index e7b8676..50410bf 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -3898,6 +3898,7 @@ void hmp_drive_add_node(Monitor *mon, const char *optstr)
>      qdict = qemu_opts_to_qdict(opts, NULL);
>  
>      if (!qdict_get_try_str(qdict, "node-name")) {
> +        QDECREF(qdict);
>          error_report("'node-name' needs to be specified");
>          goto out;
>      }

Reviewed-by: Markus Armbruster <armbru@redhat.com>

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

end of thread, other threads:[~2016-03-16 12:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-16 10:16 [Qemu-devel] [PATCH] block: Fix memory leak in hmp_drive_add_node() Kevin Wolf
2016-03-16 12:26 ` Markus Armbruster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).