pidgin: ff8f05c4: More tightly scope a variable and avoid ...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Thu Sep 24 23:47:17 EDT 2009


-----------------------------------------------------------------
Revision: ff8f05c45f3ff64c9fa0b6cfeaa6c7e44983bf38
Ancestor: fc923d51762533d8ba5e7898fe6130fb99e74937
Author: brian.lu at sun.com
Date: 2009-09-25T03:39:35
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/ff8f05c45f3ff64c9fa0b6cfeaa6c7e44983bf38

Modified files:
        COPYRIGHT ChangeLog libpurple/dnsquery.c

ChangeLog: 

More tightly scope a variable and avoid trying to free an unset variable.

Patch from Brian Lu. Closes #10242.

-------------- next part --------------
============================================================
--- COPYRIGHT	7bf3d16ae290ed74998994b7365751eaf9849a07
+++ COPYRIGHT	8259751745ac2946fb8f021227aea2365d979666
@@ -275,6 +275,7 @@ Shlomi Loubaton
 Lokheed
 Norberto Lopes
 Shlomi Loubaton
+Brian Lu
 Uli Luckas
 Matthew Luckie
 Marcus Lundblad
============================================================
--- ChangeLog	ca34559e960a037f1f199275ec1b59f3814cc785
+++ ChangeLog	1357523ac5604c768dc2ea05124bc6f450dcf13f
@@ -10,6 +10,8 @@ version 2.6.3 (??/??/20??):
 	General:
 	* New 'plugins' sub-command to 'debug' command (i.e. '/debug plugins')
 	  to announce the list of loaded plugins (in both Finch and Pidgin).
+	* Fix a crash when performing DNS queries on Unixes that use the
+	  blocking DNS lookups.  (Brian Lu)
 
 version 2.6.2 (09/05/2009):
 	libpurple:
============================================================
--- libpurple/dnsquery.c	f48c115bd2165c4a63a1f9b47ccc459c748bf4ba
+++ libpurple/dnsquery.c	be44ed4ded20b86f084e483193f56bad11f0b710
@@ -918,7 +918,6 @@ resolve_host(gpointer data)
 	PurpleDnsQueryData *query_data;
 	struct sockaddr_in sin;
 	GSList *hosts = NULL;
-	char *hostname;
 
 	query_data = data;
 	query_data->timeout = 0;
@@ -931,6 +930,7 @@ resolve_host(gpointer data)
 
 	if (!inet_aton(query_data->hostname, &sin.sin_addr)) {
 		struct hostent *hp;
+		gchar *hostname;
 #ifdef USE_IDN
 		if (!dns_str_is_ascii(query_data->hostname)) {
 			int ret = purple_network_convert_idn_to_ascii(query_data->hostname,
@@ -956,11 +956,11 @@ resolve_host(gpointer data)
 		memset(&sin, 0, sizeof(struct sockaddr_in));
 		memcpy(&sin.sin_addr.s_addr, hp->h_addr, hp->h_length);
 		sin.sin_family = hp->h_addrtype;
+		g_free(hostname);
 	} else
 		sin.sin_family = AF_INET;
 	sin.sin_port = htons(query_data->port);
 
-	g_free(hostname);
 	hosts = g_slist_append(hosts, GINT_TO_POINTER(sizeof(sin)));
 	hosts = g_slist_append(hosts, g_memdup(&sin, sizeof(sin)));
 


More information about the Commits mailing list