From: Paolo Bonzini <pbonzini@redhat.com>
To: Shannon Zhao <zhaoshenglong@huawei.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, shannon.zhao@linaro.org
Subject: Re: [Qemu-trivial] [PATCH] vl: fix memory leak spotted by valgrind
Date: Mon, 25 May 2015 15:08:05 +0200 [thread overview]
Message-ID: <55631EB5.3000507@redhat.com> (raw)
In-Reply-To: <1432536445-12760-1-git-send-email-zhaoshenglong@huawei.com>
On 25/05/2015 08:47, Shannon Zhao wrote:
> From: Shannon Zhao <shannon.zhao@linaro.org>
>
> valgrind complains about:
> ==9276== 13 bytes in 1 blocks are definitely lost in loss record 1,046 of 3,673
> ==9276== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==9276== by 0x2EAFBB: malloc_and_trace (vl.c:2556)
> ==9276== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
> ==9276== by 0x4A28BD: addr_to_string (vnc.c:123)
> ==9276== by 0x4A29AD: vnc_socket_local_addr (vnc.c:139)
> ==9276== by 0x4A9AFE: vnc_display_local_addr (vnc.c:3240)
> ==9276== by 0x2EF4FE: main (vl.c:4321)
>
> Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
> ---
> vl.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index 74c2681..9539e7b 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -4295,8 +4295,9 @@ int main(int argc, char **argv, char **envp)
> /* init remote displays */
> qemu_opts_foreach(qemu_find_opts("vnc"), vnc_init_func, NULL, 0);
> if (show_vnc_port) {
> - printf("VNC server running on `%s'\n",
> - vnc_display_local_addr("default"));
> + char *ret = vnc_display_local_addr("default");
> + printf("VNC server running on `%s'\n", ret);
> + g_free(ret);
> }
> #endif
> #ifdef CONFIG_SPICE
>
Thanks, queued for 2.4.
WARNING: multiple messages have this Message-ID (diff)
From: Paolo Bonzini <pbonzini@redhat.com>
To: Shannon Zhao <zhaoshenglong@huawei.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, shannon.zhao@linaro.org
Subject: Re: [Qemu-devel] [PATCH] vl: fix memory leak spotted by valgrind
Date: Mon, 25 May 2015 15:08:05 +0200 [thread overview]
Message-ID: <55631EB5.3000507@redhat.com> (raw)
In-Reply-To: <1432536445-12760-1-git-send-email-zhaoshenglong@huawei.com>
On 25/05/2015 08:47, Shannon Zhao wrote:
> From: Shannon Zhao <shannon.zhao@linaro.org>
>
> valgrind complains about:
> ==9276== 13 bytes in 1 blocks are definitely lost in loss record 1,046 of 3,673
> ==9276== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==9276== by 0x2EAFBB: malloc_and_trace (vl.c:2556)
> ==9276== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
> ==9276== by 0x4A28BD: addr_to_string (vnc.c:123)
> ==9276== by 0x4A29AD: vnc_socket_local_addr (vnc.c:139)
> ==9276== by 0x4A9AFE: vnc_display_local_addr (vnc.c:3240)
> ==9276== by 0x2EF4FE: main (vl.c:4321)
>
> Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
> ---
> vl.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index 74c2681..9539e7b 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -4295,8 +4295,9 @@ int main(int argc, char **argv, char **envp)
> /* init remote displays */
> qemu_opts_foreach(qemu_find_opts("vnc"), vnc_init_func, NULL, 0);
> if (show_vnc_port) {
> - printf("VNC server running on `%s'\n",
> - vnc_display_local_addr("default"));
> + char *ret = vnc_display_local_addr("default");
> + printf("VNC server running on `%s'\n", ret);
> + g_free(ret);
> }
> #endif
> #ifdef CONFIG_SPICE
>
Thanks, queued for 2.4.
next prev parent reply other threads:[~2015-05-25 13:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-25 6:47 [Qemu-trivial] [PATCH] vl: fix memory leak spotted by valgrind Shannon Zhao
2015-05-25 6:47 ` [Qemu-devel] " Shannon Zhao
2015-05-25 13:08 ` Paolo Bonzini [this message]
2015-05-25 13:08 ` Paolo Bonzini
2015-05-28 12:05 ` [Qemu-trivial] " Michael Tokarev
2015-05-28 12:05 ` [Qemu-devel] " Michael Tokarev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55631EB5.3000507@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=shannon.zhao@linaro.org \
--cc=zhaoshenglong@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.