qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: [Qemu-devel] [PULL 1/7] websock: fix handshake leak
Date: Tue, 30 Oct 2018 21:36:21 +0400	[thread overview]
Message-ID: <20181030173627.7711-2-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20181030173627.7711-1-marcandre.lureau@redhat.com>

Missed in f69a8bde293.
Thanks Valgrind:

==955== 217 bytes in 1 blocks are definitely lost in loss record 275 of 321
==955==    at 0x483A965: realloc (vg_replace_malloc.c:785)
==955==    by 0x50B6839: __vasprintf_chk (in /usr/lib64/libc-2.28.so)
==955==    by 0x49AA05C: g_vasprintf (in /usr/lib64/libglib-2.0.so.0.5800.1)
==955==    by 0x4983440: g_strdup_vprintf (in /usr/lib64/libglib-2.0.so.0.5800.1)
==955==    by 0x126048: qio_channel_websock_handshake_send_res (channel-websock.c:162)
==955==    by 0x1266E6: qio_channel_websock_handshake_send_res_ok (channel-websock.c:362)
==955==    by 0x126D3E: qio_channel_websock_handshake_process (channel-websock.c:468)
==955==    by 0x126EF2: qio_channel_websock_handshake_read (channel-websock.c:511)
==955==    by 0x12715B: qio_channel_websock_handshake_io (channel-websock.c:571)
==955==    by 0x125027: qio_channel_fd_source_dispatch (channel-watch.c:84)
==955==    by 0x496326C: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.5800.1)
==955==    by 0x169EC3: glib_pollfds_poll (main-loop.c:215)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 io/channel-websock.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/io/channel-websock.c b/io/channel-websock.c
index e6608b969d..dc43dc6bb9 100644
--- a/io/channel-websock.c
+++ b/io/channel-websock.c
@@ -163,6 +163,7 @@ qio_channel_websock_handshake_send_res(QIOChannelWebsock *ioc,
     responselen = strlen(response);
     buffer_reserve(&ioc->encoutput, responselen);
     buffer_append(&ioc->encoutput, response, responselen);
+    g_free(response);
     va_end(vargs);
 }
 
-- 
2.19.1.708.g4ede3d42df

  reply	other threads:[~2018-10-30 17:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-30 17:36 [Qemu-devel] [PULL 0/7] Chardev patches Marc-André Lureau
2018-10-30 17:36 ` Marc-André Lureau [this message]
2018-10-30 17:36 ` [Qemu-devel] [PULL 2/7] char-socket: correctly set has_reconnect when parsing QemuOpts Marc-André Lureau
2018-10-30 17:36 ` [Qemu-devel] [PULL 3/7] char-socket: make 'fd' incompatible with 'reconnect' Marc-André Lureau
2018-10-30 17:36 ` [Qemu-devel] [PULL 4/7] chardev/char-socket: Function headers refactoring Marc-André Lureau
2018-10-30 17:36 ` [Qemu-devel] [PULL 5/7] chardev: Add websocket support Marc-André Lureau
2018-10-30 17:36 ` [Qemu-devel] [PULL 6/7] tests/test-char: Check websocket chardev functionality Marc-André Lureau
2018-10-30 17:36 ` [Qemu-devel] [PULL 7/7] editorconfig: set emacs mode Marc-André Lureau
2018-10-31 16:11 ` [Qemu-devel] [PULL 0/7] Chardev patches Peter Maydell

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=20181030173627.7711-2-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=berrange@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 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).