diff options
author | Frediano Ziglio <fziglio@redhat.com> | 2015-12-09 13:34:15 +0000 |
---|---|---|
committer | Frediano Ziglio <fziglio@redhat.com> | 2015-12-10 17:36:25 +0000 |
commit | e7c79b71a40a6340849caa7f9345e3c8a7075664 (patch) | |
tree | 6fb2753c73daea8376c2458d5f50a5b5abb9edfb /server/red-channel.c | |
parent | b12187b332123da383f52748e2865e0309d45d76 (diff) |
channel: make sure we retain RedChannelClient while processing it
During display_channel_handle_migrate_data the pointer is passed
to different functions which could release it making the pointer
invalid. Make sure pointer is not freed while processing.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Diffstat (limited to 'server/red-channel.c')
-rw-r--r-- | server/red-channel.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/server/red-channel.c b/server/red-channel.c index 4b1d4263..7dfb9bf6 100644 --- a/server/red-channel.c +++ b/server/red-channel.c @@ -116,8 +116,6 @@ static inline int red_channel_client_waiting_for_ack(RedChannelClient *rcc); */ static void red_channel_ref(RedChannel *channel); static void red_channel_unref(RedChannel *channel); -static void red_channel_client_ref(RedChannelClient *rcc); -static void red_channel_client_unref(RedChannelClient *rcc); static uint32_t full_header_get_msg_size(SpiceDataHeaderOpaque *header) { @@ -1231,12 +1229,12 @@ static void red_channel_unref(RedChannel *channel) } } -static void red_channel_client_ref(RedChannelClient *rcc) +void red_channel_client_ref(RedChannelClient *rcc) { rcc->refs++; } -static void red_channel_client_unref(RedChannelClient *rcc) +void red_channel_client_unref(RedChannelClient *rcc) { if (!--rcc->refs) { spice_debug("destroy rcc=%p", rcc); |