From nobody Fri May 3 07:38:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539944113084617.5565534598576; Fri, 19 Oct 2018 03:15:13 -0700 (PDT) Received: from localhost ([::1]:48315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDRo2-0007Bp-Eu for importer@patchew.org; Fri, 19 Oct 2018 06:14:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDRn7-0006tY-FP for qemu-devel@nongnu.org; Fri, 19 Oct 2018 06:14:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDRn1-0007O9-W9 for qemu-devel@nongnu.org; Fri, 19 Oct 2018 06:14:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36656) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gDRn1-0007Jj-QM for qemu-devel@nongnu.org; Fri, 19 Oct 2018 06:13:55 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C363B80F96; Fri, 19 Oct 2018 10:13:53 +0000 (UTC) Received: from localhost (ovpn-112-54.ams2.redhat.com [10.36.112.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE587600C8; Fri, 19 Oct 2018 10:13:50 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Fri, 19 Oct 2018 14:13:46 +0400 Message-Id: <20181019101346.3316-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 19 Oct 2018 10:13:53 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] websock: fix handshake leak X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jusual@mail.ru, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Thanks Valgrind: =3D=3D955=3D=3D 217 bytes in 1 blocks are definitely lost in loss record 27= 5 of 321 =3D=3D955=3D=3D at 0x483A965: realloc (vg_replace_malloc.c:785) =3D=3D955=3D=3D by 0x50B6839: __vasprintf_chk (in /usr/lib64/libc-2.28.s= o) =3D=3D955=3D=3D by 0x49AA05C: g_vasprintf (in /usr/lib64/libglib-2.0.so.= 0.5800.1) =3D=3D955=3D=3D by 0x4983440: g_strdup_vprintf (in /usr/lib64/libglib-2.= 0.so.0.5800.1) =3D=3D955=3D=3D by 0x126048: qio_channel_websock_handshake_send_res (cha= nnel-websock.c:162) =3D=3D955=3D=3D by 0x1266E6: qio_channel_websock_handshake_send_res_ok (= channel-websock.c:362) =3D=3D955=3D=3D by 0x126D3E: qio_channel_websock_handshake_process (chan= nel-websock.c:468) =3D=3D955=3D=3D by 0x126EF2: qio_channel_websock_handshake_read (channel= -websock.c:511) =3D=3D955=3D=3D by 0x12715B: qio_channel_websock_handshake_io (channel-w= ebsock.c:571) =3D=3D955=3D=3D by 0x125027: qio_channel_fd_source_dispatch (channel-wat= ch.c:84) =3D=3D955=3D=3D by 0x496326C: g_main_context_dispatch (in /usr/lib64/lib= glib-2.0.so.0.5800.1) =3D=3D955=3D=3D by 0x169EC3: glib_pollfds_poll (main-loop.c:215) Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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(QIOChannelWebsoc= k *ioc, responselen =3D strlen(response); buffer_reserve(&ioc->encoutput, responselen); buffer_append(&ioc->encoutput, response, responselen); + g_free(response); va_end(vargs); } =20 --=20 2.19.0.271.gfe8321ec05