diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> | 2010-10-08 17:09:44 -0400 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> | 2010-10-13 11:28:10 -0400 |
commit | 7c4468651d85d3904a7f2365c1d55e862cc44c7d (patch) | |
tree | 1675a16d9796b369063dab9c3417590f28b65bf5 /tests/wocky-test-connector-server.c | |
parent | d8b8d403234d177b9ab1f7aed29569c1f434bca5 (diff) |
Don't leak TLSConnection
Diffstat (limited to 'tests/wocky-test-connector-server.c')
-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); } |