Don't free the resolved addresses if they have already been freed. Fixed LM-96
Patch from Senko Rasic
--- a/loudmouth/lm-connection.c Sun Feb 25 00:13:01 2007 +0100
+++ b/loudmouth/lm-connection.c Tue Apr 24 19:42:00 2007 +0200
@@ -511,9 +511,13 @@
_lm_utils_free_callback (cb);
}
- freeaddrinfo (connect_data->resolved_addrs);
- connection->connect_data = NULL;
- g_free (connect_data);
+ /* If the user callback called connection_close(), this is
+ * already freed */
+ if (connection->connect_data) {
+ freeaddrinfo (connect_data->resolved_addrs);
+ connection->connect_data = NULL;
+ g_free (connect_data);
+ }
} else {
/* try to connect to the next host */
connection_do_connect (connect_data);