diff options
-rw-r--r-- | tests/wocky-test-connector-server.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/wocky-test-connector-server.c b/tests/wocky-test-connector-server.c index 391fe1a..6c3bff3 100644 --- a/tests/wocky-test-connector-server.c +++ b/tests/wocky-test-connector-server.c @@ -104,7 +104,6 @@ struct _TestConnectorServerPrivate CertSet cert; WockyTLSSession *tls_sess; - WockyTLSConnection *tls_conn; GCancellable *cancellable; gint outstanding; @@ -1056,11 +1055,12 @@ handshake_cb (GObject *source, { TestConnectorServer *self = TEST_CONNECTOR_SERVER (user_data); TestConnectorServerPrivate *priv = self->priv; + WockyTLSConnection *tls_conn; GError *error = NULL; DEBUG ("TLS/SSL handshake finished"); - priv->tls_conn = wocky_tls_session_handshake_finish ( + tls_conn = wocky_tls_session_handshake_finish ( WOCKY_TLS_SESSION (source), result, &error); @@ -1068,7 +1068,7 @@ handshake_cb (GObject *source, if (server_dec_outstanding (self)) return; - if (priv->tls_conn == NULL) + if (tls_conn == NULL) { DEBUG ("SSL or TLS Server Setup failed: %s", error->message); g_io_stream_close (priv->stream, NULL, NULL); @@ -1079,7 +1079,8 @@ handshake_cb (GObject *source, g_object_unref (priv->conn); priv->state = SERVER_STATE_START; - priv->conn = wocky_xmpp_connection_new (G_IO_STREAM (priv->tls_conn)); + priv->conn = wocky_xmpp_connection_new (G_IO_STREAM (tls_conn)); + g_object_unref (tls_conn); priv->tls_started = TRUE; xmpp_init (NULL,NULL,self); } |