[Spice-devel] [PATCH spice-server 2/5] red-worker: Remove small memory leak

Frediano Ziglio fziglio at redhat.com
Thu Aug 24 14:37:17 UTC 2017


If a DisplayChannelClient cannot be instantiated capabilities
are not released correctly.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/red-worker.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/server/red-worker.c b/server/red-worker.c
index 03a409cd..8fd964ea 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -724,14 +724,13 @@ static void handle_dev_display_connect(void *opaque, void *payload)
 
     dcc = dcc_new(display, msg->client, msg->stream, msg->migration, &msg->caps,
                   worker->image_compression, worker->jpeg_state, worker->zlib_glz_state);
+    red_channel_capabilities_reset(&msg->caps);
     if (!dcc) {
         return;
     }
     display_channel_update_compression(display, dcc);
     guest_set_client_capabilities(worker);
     dcc_start(dcc);
-
-    red_channel_capabilities_reset(&msg->caps);
 }
 
 static void handle_dev_display_disconnect(void *opaque, void *payload)
-- 
2.13.5



More information about the Spice-devel mailing list