qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: marcandre.lureau@redhat.com
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PULL for-2.7 3/9] char: free MuxDriver when closing
Date: Mon,  8 Aug 2016 00:05:55 +0400	[thread overview]
Message-ID: <20160807200601.25905-4-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20160807200601.25905-1-marcandre.lureau@redhat.com>

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Similarly to other chr_close callbacks, free char type specific data.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
 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);
 }
 
+static void mux_chr_close(struct CharDriverState *chr)
+{
+    MuxDriver *d = chr->opaque;
+
+    g_free(d);
+}
+
 static CharDriverState *qemu_chr_open_mux(const char *id,
                                           ChardevBackend *backend,
                                           ChardevReturn *ret, Error **errp)
@@ -810,6 +817,7 @@ static CharDriverState *qemu_chr_open_mux(const char *id,
     chr->opaque = d;
     d->drv = drv;
     d->focus = -1;
+    chr->chr_close = mux_chr_close;
     chr->chr_write = mux_chr_write;
     chr->chr_update_read_handler = mux_chr_update_read_handler;
     chr->chr_accept_input = mux_chr_accept_input;
-- 
2.9.0

  parent reply	other threads:[~2016-08-07 20:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-07 20:05 [Qemu-devel] [PULL for-2.7 0/9] Leak fixes for 2.7 marcandre.lureau
2016-08-07 20:05 ` [Qemu-devel] [PULL for-2.7 1/9] numa: do not leak NumaOptions marcandre.lureau
2016-08-07 20:05 ` [Qemu-devel] [PULL for-2.7 2/9] char: free the tcp connection data when closing marcandre.lureau
2016-08-07 20:05 ` marcandre.lureau [this message]
2016-08-07 20:05 ` [Qemu-devel] [PULL for-2.7 4/9] ahci: free irqs array marcandre.lureau
2016-08-07 20:05 ` [Qemu-devel] [PULL for-2.7 5/9] qjson: free str marcandre.lureau
2016-08-07 20:05 ` [Qemu-devel] [PULL for-2.7 6/9] virtio-input: free config list marcandre.lureau
2016-08-07 20:05 ` [Qemu-devel] [PULL for-2.7 7/9] usb: free USBDevice.strings marcandre.lureau
2016-08-07 20:06 ` [Qemu-devel] [PULL for-2.7 8/9] usb: free leaking path marcandre.lureau
2016-08-07 20:06 ` [Qemu-devel] [PULL for-2.7 9/9] ahci: fix sglist leak on retry marcandre.lureau
2016-08-08 12:25 ` [Qemu-devel] [PULL for-2.7 0/9] Leak fixes for 2.7 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=20160807200601.25905-4-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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).