im.pidgin.pidgin: 077670cb60ab530215573771befe704110370be0

datallah at pidgin.im datallah at pidgin.im
Fri Oct 5 01:35:36 EDT 2007


revision:            077670cb60ab530215573771befe704110370be0
date:                2007-10-05T05:28:54
author:              datallah at pidgin.im
branch:              im.pidgin.pidgin
changelog:
Fix leakage in the win32 dnsquery implementation.

manifest:
format_version "1"

new_manifest [616b808c693df0c0a690a9c654d791c5dfbf13c3]

old_revision [77376fe079e753b612b3b8c901060e689f3dee11]

patch "libpurple/dnsquery.c"
 from [e3aec839245d62f0f23611a9e668b88dc73ff2ce]
   to [0ddd5e827518101947da5f67acc3b436926f83bc]
-------------- next part --------------
#
#
# patch "libpurple/dnsquery.c"
#  from [e3aec839245d62f0f23611a9e668b88dc73ff2ce]
#    to [0ddd5e827518101947da5f67acc3b436926f83bc]
#
============================================================
--- libpurple/dnsquery.c	e3aec839245d62f0f23611a9e668b88dc73ff2ce
+++ libpurple/dnsquery.c	0ddd5e827518101947da5f67acc3b436926f83bc
@@ -637,9 +637,10 @@ dns_main_thread_cb(gpointer data)
 static gboolean
 dns_main_thread_cb(gpointer data)
 {
-	PurpleDnsQueryData *query_data;
+	PurpleDnsQueryData *query_data = data;
 
-	query_data = data;
+	/* We're done, so purple_dnsquery_destroy() shouldn't think it is canceling an in-progress lookup */
+	query_data->resolver = NULL;
 
 	if (query_data->error_message != NULL)
 		purple_dnsquery_failed(query_data, query_data->error_message);
@@ -713,7 +714,7 @@ dns_thread(gpointer data)
 #endif
 
 	/* back to main thread */
-	g_idle_add(dns_main_thread_cb, query_data);
+	purple_timeout_add(0, dns_main_thread_cb, query_data);
 
 	return 0;
 }
@@ -780,14 +781,12 @@ purple_dnsquery_a(const char *hostname, 
 
 	purple_debug_info("dnsquery", "Performing DNS lookup for %s\n", hostname);
 
-	query_data = g_new(PurpleDnsQueryData, 1);
+	query_data = g_new0(PurpleDnsQueryData, 1);
 	query_data->hostname = g_strdup(hostname);
 	g_strstrip(query_data->hostname);
 	query_data->port = port;
 	query_data->callback = callback;
 	query_data->data = data;
-	query_data->error_message = NULL;
-	query_data->hosts = NULL;
 
 	if (strlen(query_data->hostname) == 0)
 	{


More information about the Commits mailing list