# HG changeset patch # User brian.lu@sun.com # Date 1253849975 0 # Node ID 578b4048a501ad458a3f5cb2c74e2aed96d4dac2 # Parent c42d5c23a9e893a4e834cab235e6202d4cf0855a More tightly scope a variable and avoid trying to free an unset variable. Patch from Brian Lu. Closes #10242. committer: Paul Aurich diff -r c42d5c23a9e8 -r 578b4048a501 COPYRIGHT --- a/COPYRIGHT Thu Sep 24 16:58:31 2009 +0000 +++ b/COPYRIGHT Fri Sep 25 03:39:35 2009 +0000 @@ -275,6 +275,7 @@ Lokheed Norberto Lopes Shlomi Loubaton +Brian Lu Uli Luckas Matthew Luckie Marcus Lundblad diff -r c42d5c23a9e8 -r 578b4048a501 ChangeLog --- a/ChangeLog Thu Sep 24 16:58:31 2009 +0000 +++ b/ChangeLog Fri Sep 25 03:39:35 2009 +0000 @@ -10,6 +10,8 @@ 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: diff -r c42d5c23a9e8 -r 578b4048a501 libpurple/dnsquery.c --- a/libpurple/dnsquery.c Thu Sep 24 16:58:31 2009 +0000 +++ b/libpurple/dnsquery.c Fri Sep 25 03:39:35 2009 +0000 @@ -918,7 +918,6 @@ PurpleDnsQueryData *query_data; struct sockaddr_in sin; GSList *hosts = NULL; - char *hostname; query_data = data; query_data->timeout = 0; @@ -931,6 +930,7 @@ 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 @@ 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)));