[PATCH spice 7/9] red-channel: do not call pipe_add with NULL item

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Marc-André Lureau <mlureau@xxxxxxxxxx>

For some client, it might not be possible to create an item. In this
case, don't call pipe_add() callback.

Signed-off-by: Marc-André Lureau <mlureau@xxxxxxxxxx>
---
 server/red-channel.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/server/red-channel.c b/server/red-channel.c
index ce4c691..fcbe868 100644
--- a/server/red-channel.c
+++ b/server/red-channel.c
@@ -2242,10 +2242,12 @@ static void red_channel_pipes_create_batch(RedChannel *channel,
     PipeItem *item;
     int num = 0;
 
+    spice_assert(callback);
+
     RING_FOREACH_SAFE(link, next, &channel->clients) {
         rcc = SPICE_CONTAINEROF(link, RedChannelClient, channel_link);
         item = (*creator)(rcc, data, num++);
-        if (callback) {
+        if (item != NULL) {
             (*callback)(rcc, item);
         }
     }
-- 
2.5.0

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]