Do not check rcc after being use but before.

Signed-off-by: Frediano Ziglio <[email protected]>
---
 server/spicevmc.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/server/spicevmc.c b/server/spicevmc.c
index 064910e..df776f4 100644
--- a/server/spicevmc.c
+++ b/server/spicevmc.c
@@ -450,12 +450,11 @@ static void 
spicevmc_red_channel_client_on_disconnect(RedChannelClient *rcc)
 {
     RedVmcChannel *channel;
     SpiceCharDeviceInterface *sif;
-    RedClient *client = red_channel_client_get_client(rcc);
+    RedClient *client;
 
-    if (!rcc) {
-        return;
-    }
+    g_return_if_fail(rcc != NULL);
 
+    client = red_channel_client_get_client(rcc);
     channel = RED_VMC_CHANNEL(red_channel_client_get_channel(rcc));
 
     /* partial message which wasn't pushed to device */
-- 
2.9.3

_______________________________________________
Spice-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to