summaryrefslogtreecommitdiffstats
path: root/server/char_device.c
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2012-11-19 17:22:51 -0500
committerYonit Halperin <yhalperi@redhat.com>2012-11-26 11:08:10 -0500
commit0ca75b02350522bedb7b98ab679be9e3851cca76 (patch)
tree70750f1ff5166814a0ef94166cb9f3635bdaeb96 /server/char_device.c
parentd6b3f73102926c299934c5845bfc26f30af5c719 (diff)
downloadspice-0ca75b02350522bedb7b98ab679be9e3851cca76.tar.gz
spice-0ca75b02350522bedb7b98ab679be9e3851cca76.tar.xz
spice-0ca75b02350522bedb7b98ab679be9e3851cca76.zip
char_device.c: when the state is destroyed, also free the buffer that is being written to the device
Diffstat (limited to 'server/char_device.c')
-rw-r--r--server/char_device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/server/char_device.c b/server/char_device.c
index d7f5360a..1d5bed92 100644
--- a/server/char_device.c
+++ b/server/char_device.c
@@ -689,6 +689,9 @@ void spice_char_device_state_destroy(SpiceCharDeviceState *char_dev)
core->timer_remove(char_dev->write_to_dev_timer);
write_buffers_queue_free(&char_dev->write_queue);
write_buffers_queue_free(&char_dev->write_bufs_pool);
+ if (char_dev->cur_write_buf) {
+ spice_char_device_write_buffer_free(char_dev->cur_write_buf);
+ }
while (!ring_is_empty(&char_dev->clients)) {
RingItem *item = ring_get_tail(&char_dev->clients);