From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41452) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSmTI-0000UH-1U for qemu-devel@nongnu.org; Thu, 28 Jul 2016 10:39:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSmTG-0000vc-3q for qemu-devel@nongnu.org; Thu, 28 Jul 2016 10:39:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43672) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSmTF-0000vS-UE for qemu-devel@nongnu.org; Thu, 28 Jul 2016 10:39:34 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7C4E78B13F for ; Thu, 28 Jul 2016 14:39:33 +0000 (UTC) From: marcandre.lureau@redhat.com Date: Thu, 28 Jul 2016 18:37:51 +0400 Message-Id: <20160728143808.13707-21-marcandre.lureau@redhat.com> In-Reply-To: <20160728143808.13707-1-marcandre.lureau@redhat.com> References: <20160728143808.13707-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v2 20/37] char: free MuxDriver when closing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: eblake@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-Andr=C3=A9 Lureau Similarly to other chr_close callbacks, free char type specific data. Signed-off-by: Marc-Andr=C3=A9 Lureau --- qemu-char.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/qemu-char.c b/qemu-char.c index 6ed6dd6..e276485 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -786,6 +786,14 @@ static GSource *mux_chr_add_watch(CharDriverState *s= , GIOCondition cond) return d->drv->chr_add_watch(d->drv, cond); } =20 +static void mux_chr_close(struct CharDriverState *chr) +{ + MuxDriver *d =3D chr->opaque; + + /* is more cleanup needed? */ + g_free(d); +} + static CharDriverState *qemu_chr_open_mux(const char *id, ChardevBackend *backend, ChardevReturn *ret, Error **er= rp) @@ -810,6 +818,7 @@ static CharDriverState *qemu_chr_open_mux(const char = *id, chr->opaque =3D d; d->drv =3D drv; d->focus =3D -1; + chr->chr_close =3D mux_chr_close; chr->chr_write =3D mux_chr_write; chr->chr_update_read_handler =3D mux_chr_update_read_handler; chr->chr_accept_input =3D mux_chr_accept_input; --=20 2.9.0