qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] util/error: Fix leak in error_vprepend()
@ 2017-04-13 16:09 Max Reitz
  2017-04-17  7:08 ` Fam Zheng
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Max Reitz @ 2017-04-13 16:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Max Reitz, Markus Armbruster

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 util/error.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/util/error.c b/util/error.c
index 9c40b1f458..020b86b9f0 100644
--- a/util/error.c
+++ b/util/error.c
@@ -134,6 +134,7 @@ void error_vprepend(Error **errp, const char *fmt, va_list ap)
     newmsg = g_string_new(NULL);
     g_string_vprintf(newmsg, fmt, ap);
     g_string_append(newmsg, (*errp)->msg);
+    g_free((*errp)->msg);
     (*errp)->msg = g_string_free(newmsg, 0);
 }
 
-- 
2.12.2

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

* Re: [Qemu-devel] [PATCH] util/error: Fix leak in error_vprepend()
  2017-04-13 16:09 [Qemu-devel] [PATCH] util/error: Fix leak in error_vprepend() Max Reitz
@ 2017-04-17  7:08 ` Fam Zheng
  2017-04-17 11:28 ` Jeff Cody
  2017-04-20 16:07 ` Markus Armbruster
  2 siblings, 0 replies; 4+ messages in thread
From: Fam Zheng @ 2017-04-17  7:08 UTC (permalink / raw)
  To: Max Reitz; +Cc: qemu-devel, Markus Armbruster

On Thu, 04/13 18:09, Max Reitz wrote:
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  util/error.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/util/error.c b/util/error.c
> index 9c40b1f458..020b86b9f0 100644
> --- a/util/error.c
> +++ b/util/error.c
> @@ -134,6 +134,7 @@ void error_vprepend(Error **errp, const char *fmt, va_list ap)
>      newmsg = g_string_new(NULL);
>      g_string_vprintf(newmsg, fmt, ap);
>      g_string_append(newmsg, (*errp)->msg);
> +    g_free((*errp)->msg);
>      (*errp)->msg = g_string_free(newmsg, 0);
>  }
>  
> -- 
> 2.12.2
> 
> 

Reviewed-by: Fam Zheng <famz@redhat.com>

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

* Re: [Qemu-devel] [PATCH] util/error: Fix leak in error_vprepend()
  2017-04-13 16:09 [Qemu-devel] [PATCH] util/error: Fix leak in error_vprepend() Max Reitz
  2017-04-17  7:08 ` Fam Zheng
@ 2017-04-17 11:28 ` Jeff Cody
  2017-04-20 16:07 ` Markus Armbruster
  2 siblings, 0 replies; 4+ messages in thread
From: Jeff Cody @ 2017-04-17 11:28 UTC (permalink / raw)
  To: Max Reitz; +Cc: qemu-devel, Markus Armbruster

On Thu, Apr 13, 2017 at 06:09:52PM +0200, Max Reitz wrote:
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  util/error.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/util/error.c b/util/error.c
> index 9c40b1f458..020b86b9f0 100644
> --- a/util/error.c
> +++ b/util/error.c
> @@ -134,6 +134,7 @@ void error_vprepend(Error **errp, const char *fmt, va_list ap)
>      newmsg = g_string_new(NULL);
>      g_string_vprintf(newmsg, fmt, ap);
>      g_string_append(newmsg, (*errp)->msg);
> +    g_free((*errp)->msg);
>      (*errp)->msg = g_string_free(newmsg, 0);
>  }
>  
> -- 
> 2.12.2
> 
>

Reviewed-by: Jeff Cody <jcody@redhat.com>

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

* Re: [Qemu-devel] [PATCH] util/error: Fix leak in error_vprepend()
  2017-04-13 16:09 [Qemu-devel] [PATCH] util/error: Fix leak in error_vprepend() Max Reitz
  2017-04-17  7:08 ` Fam Zheng
  2017-04-17 11:28 ` Jeff Cody
@ 2017-04-20 16:07 ` Markus Armbruster
  2 siblings, 0 replies; 4+ messages in thread
From: Markus Armbruster @ 2017-04-20 16:07 UTC (permalink / raw)
  To: Max Reitz; +Cc: qemu-devel

Max Reitz <mreitz@redhat.com> writes:

> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  util/error.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/util/error.c b/util/error.c
> index 9c40b1f458..020b86b9f0 100644
> --- a/util/error.c
> +++ b/util/error.c
> @@ -134,6 +134,7 @@ void error_vprepend(Error **errp, const char *fmt, va_list ap)
>      newmsg = g_string_new(NULL);
>      g_string_vprintf(newmsg, fmt, ap);
>      g_string_append(newmsg, (*errp)->msg);
> +    g_free((*errp)->msg);
>      (*errp)->msg = g_string_free(newmsg, 0);
>  }

Applied to error-next, thanks!

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

end of thread, other threads:[~2017-04-20 16:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-13 16:09 [Qemu-devel] [PATCH] util/error: Fix leak in error_vprepend() Max Reitz
2017-04-17  7:08 ` Fam Zheng
2017-04-17 11:28 ` Jeff Cody
2017-04-20 16:07 ` 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).