Received: from eggs.gnu.org ([2001:4830:134:3::10]:59813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWUKx-0008WJ-EM for qemu-devel@nongnu.org; Sun, 07 Aug 2016 16:06:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bWUKu-0007Iq-6k for qemu-devel@nongnu.org; Sun, 07 Aug 2016 16:06:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58938) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWUKu-0007Ij-13 for qemu-devel@nongnu.org; Sun, 07 Aug 2016 16:06:16 -0400 From: marcandre.lureau@redhat.com Date: Mon, 8 Aug 2016 00:05:55 +0400 Message-Id: <20160807200601.25905-4-marcandre.lureau@redhat.com> In-Reply-To: <20160807200601.25905-1-marcandre.lureau@redhat.com> References: <20160807200601.25905-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL for-2.7 3/9] char: free MuxDriver when closing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?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 7c529b2..8a0ab05 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