[Spice-devel] [spice-gtk 2/2] spice_channel_coroutine: fix function exit in error path

Christophe Fergeau cfergeau at redhat.com
Mon Jun 11 02:17:20 PDT 2012


spice_channel_coroutine returns a void *, but one of its error path
is doing 'return FALSE'. This commit replaces this return with a
'goto cleanup' since this is what is done in the other error paths.
---
 gtk/spice-channel.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
index fd63ca0..851fc23 100644
--- a/gtk/spice-channel.c
+++ b/gtk/spice-channel.c
@@ -2107,7 +2107,7 @@ static void *spice_channel_coroutine(void *data)
         if (!(c->sock = g_socket_new_from_fd(c->fd, NULL))) {
                 SPICE_DEBUG("Failed to open socket from fd %d", c->fd);
                 emit_main_context(channel, SPICE_CHANNEL_EVENT, SPICE_CHANNEL_ERROR_CONNECT);
-                return FALSE;
+                goto cleanup;
         }
 
         g_socket_set_blocking(c->sock, FALSE);
-- 
1.7.10.2



More information about the Spice-devel mailing list