Fixed a crash when lm_connection_close was called.
authorMikael Hallendal <micke@imendio.com>
Mon, 06 Oct 2008 02:17:27 +0200
changeset 503 c7c1722ec2db
parent 502 4b69fbfa8797
child 504 1fafee646928
Fixed a crash when lm_connection_close was called. Check if the socket exists before trying to cancel the asyncns call on it.
loudmouth/lm-connection.c
--- a/loudmouth/lm-connection.c	Mon Oct 06 02:09:58 2008 +0200
+++ b/loudmouth/lm-connection.c	Mon Oct 06 02:17:27 2008 +0200
@@ -1437,7 +1437,9 @@
 	
 	g_return_val_if_fail (connection != NULL, FALSE);
 
-	lm_old_socket_asyncns_cancel (connection->socket);
+        if (connection->socket) {
+                lm_old_socket_asyncns_cancel (connection->socket);
+        }
 
 	if (connection->state == LM_CONNECTION_STATE_CLOSED) {
 		g_set_error (error,