[Spice-devel] [PATCH 23/23] use reference counting for RedPipeItem

Frediano Ziglio fziglio at redhat.com
Mon May 16 13:31:33 UTC 2016


Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/red-channel.c | 2 +-
 server/spicevmc.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/red-channel.c b/server/red-channel.c
index 803570c..9aef363 100644
--- a/server/red-channel.c
+++ b/server/red-channel.c
@@ -578,7 +578,7 @@ static void red_channel_client_send_item(RedChannelClient *rcc, RedPipeItem *ite
             rcc->channel->channel_cbs.send_item(rcc, item);
             return;
     }
-    free(item);
+    red_pipe_item_unref(item);
 }
 
 static inline void red_channel_client_release_sent_item(RedChannelClient *rcc)
diff --git a/server/spicevmc.c b/server/spicevmc.c
index 1e9406e..14d34b4 100644
--- a/server/spicevmc.c
+++ b/server/spicevmc.c
@@ -431,7 +431,7 @@ static void spicevmc_red_channel_send_item(RedChannelClient *rcc,
         break;
     default:
         spice_error("bad pipe item %d", item->type);
-        free(item);
+        red_pipe_item_unref(item);
         return;
     }
     red_channel_client_begin_send_message(rcc);
-- 
2.7.4



More information about the Spice-devel mailing list