SoupConnection: Quiet a (mistaken) compiler warning
authorColin Walters <walters@verbum.org>
Fri, 14 Dec 2012 21:02:48 +0000 (16:02 -0500)
committerColin Walters <walters@verbum.org>
Fri, 14 Dec 2012 21:29:27 +0000 (16:29 -0500)
gcc claims 'event_id' might be uninitialized; it's wrong, but it's
hard for the optimizer to know that.  Placate it in the name of
reducing warnings.

https://bugzilla.gnome.org/show_bug.cgi?id=690224

libsoup/soup-connection.c

index 34b9b2d..2161394 100644 (file)
@@ -604,7 +604,7 @@ guint
 soup_connection_connect_sync (SoupConnection *conn, GCancellable *cancellable)
 {
        SoupConnectionPrivate *priv;
-       guint status, event_id;
+       guint status, event_id = 0;
        SoupURI *connect_uri;
        SoupAddress *remote_addr;
 
@@ -690,7 +690,7 @@ soup_connection_connect_sync (SoupConnection *conn, GCancellable *cancellable)
                soup_connection_disconnect (conn);
        }
 
-       if (priv->socket)
+       if (priv->socket && event_id)
                g_signal_handler_disconnect (priv->socket, event_id);
 
        if (priv->proxy_uri != NULL)