From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVaSD-0002eR-Lc for qemu-devel@nongnu.org; Fri, 05 Aug 2016 04:26:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVaS9-0002Q9-B7 for qemu-devel@nongnu.org; Fri, 05 Aug 2016 04:26:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12401) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVaS9-0002Px-56 for qemu-devel@nongnu.org; Fri, 05 Aug 2016 04:26:01 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (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 BBBC4C05678E for ; Fri, 5 Aug 2016 08:26:00 +0000 (UTC) From: marcandre.lureau@redhat.com Date: Fri, 5 Aug 2016 12:24:05 +0400 Message-Id: <20160805082421.21994-21-marcandre.lureau@redhat.com> In-Reply-To: <20160805082421.21994-1-marcandre.lureau@redhat.com> References: <20160805082421.21994-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 for-2.7 v4 20/36] char: free MuxDriver when closing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, eblake@redhat.com, armbru@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 Reviewed-by: Eric Blake --- qemu-char.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qemu-char.c b/qemu-char.c index f20d385..539dd70 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -786,6 +786,13 @@ 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; + + g_free(d); +} + static CharDriverState *qemu_chr_open_mux(const char *id, ChardevBackend *backend, ChardevReturn *ret, Error **er= rp) @@ -810,6 +817,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