[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL for-2.7 3/9] char: free MuxDriver when closing
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PULL for-2.7 3/9] char: free MuxDriver when closing |
Date: |
Mon, 8 Aug 2016 00:05:55 +0400 |
From: Marc-André Lureau <address@hidden>
Similarly to other chr_close callbacks, free char type specific data.
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
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
- [Qemu-devel] [PULL for-2.7 0/9] Leak fixes for 2.7, marcandre . lureau, 2016/08/07
- [Qemu-devel] [PULL for-2.7 1/9] numa: do not leak NumaOptions, marcandre . lureau, 2016/08/07
- [Qemu-devel] [PULL for-2.7 2/9] char: free the tcp connection data when closing, marcandre . lureau, 2016/08/07
- [Qemu-devel] [PULL for-2.7 3/9] char: free MuxDriver when closing,
marcandre . lureau <=
- [Qemu-devel] [PULL for-2.7 4/9] ahci: free irqs array, marcandre . lureau, 2016/08/07
- [Qemu-devel] [PULL for-2.7 5/9] qjson: free str, marcandre . lureau, 2016/08/07
- [Qemu-devel] [PULL for-2.7 6/9] virtio-input: free config list, marcandre . lureau, 2016/08/07
- [Qemu-devel] [PULL for-2.7 7/9] usb: free USBDevice.strings, marcandre . lureau, 2016/08/07
- [Qemu-devel] [PULL for-2.7 8/9] usb: free leaking path, marcandre . lureau, 2016/08/07
- [Qemu-devel] [PULL for-2.7 9/9] ahci: fix sglist leak on retry, marcandre . lureau, 2016/08/07
- Re: [Qemu-devel] [PULL for-2.7 0/9] Leak fixes for 2.7, Peter Maydell, 2016/08/08