[Spice-devel,v4,2/7] Free inputs_channel in spice_server_destroy

Submitted by Frediano Ziglio on Dec. 2, 2016, 5:43 p.m.

Details

Message ID 009c07d8e837adea976ed65cf16e190aa03af6e2.1480700546.git-series.fziglio@redhat.com
State Accepted
Commit 8dbfd4971a1bf4605d7496a058923a5838142b69
Headers show
Series "Start cleaning objects on destruction" ( rev: 6 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio Dec. 2, 2016, 5:43 p.m.
Avoid leaking this channel.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
---
 server/reds.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/server/reds.c b/server/reds.c
index 479a815..17e5ada 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3592,6 +3592,10 @@  SPICE_GNUC_VISIBLE void spice_server_destroy(SpiceServer *reds)
     servers = g_list_remove(servers, reds);
     pthread_mutex_unlock(&global_reds_lock);
 
+    if (reds->inputs_channel) {
+        reds_unregister_channel(reds, RED_CHANNEL(reds->inputs_channel));
+        red_channel_destroy(RED_CHANNEL(reds->inputs_channel));
+    }
     if (reds->main_channel) {
         red_channel_destroy(RED_CHANNEL(reds->main_channel));
     }