[Spice-devel] [PATCH spice-server 05/10] reds: fix memory leak when core->base.minor_version < 3

Yonit Halperin yhalperi at redhat.com
Wed May 8 07:06:20 PDT 2013


---
 server/reds.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/server/reds.c b/server/reds.c
index a378f80..f6a1ce9 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -196,10 +196,9 @@ static void reds_stream_push_channel_event(RedsStream *s, int event)
 
 void reds_handle_channel_event(int event, SpiceChannelEventInfo *info)
 {
-    if (core->base.minor_version < 3 || core->channel_event == NULL)
-        return;
+    if (core->base.minor_version >= 3 && core->channel_event != NULL)
+        core->channel_event(event, info);
 
-    core->channel_event(event, info);
     if (event == SPICE_CHANNEL_EVENT_DISCONNECTED) {
         free(info);
     }
-- 
1.8.1.4



More information about the Spice-devel mailing list