changeset 28674:858d9563ee8c

merge of '6a834614341327cc0cbbdc3887692354df8999e3' and '903af32836ce489b57aec5f255ba91e9e675526f'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 29 Sep 2009 01:36:03 +0000
parents dfabdc9cce88 (current diff) 67a97fca157c (diff)
children a501f14e6961
files
diffstat 2 files changed, 9 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/dnsquery.c	Mon Sep 28 17:41:56 2009 +0000
+++ b/libpurple/dnsquery.c	Tue Sep 29 01:36:03 2009 +0000
@@ -328,6 +328,8 @@
 				printf("dns[%d] Error: getaddrinfo returned %d\n",
 					getpid(), rc);
 			dns_params.hostname[0] = '\0';
+			g_free(hostname);
+			hostname = NULL;
 			continue;
 		}
 		tmp = res;
@@ -774,11 +776,8 @@
 	if (!dns_str_is_ascii(query_data->hostname)) {
 		rc = purple_network_convert_idn_to_ascii(query_data->hostname, &hostname);
 		if (rc != 0) {
-			/* FIXME: Dirty 2.6.0 string freeze hack */
-			char tmp[8];
-			g_snprintf(tmp, sizeof(tmp), "%d", rc);
-			query_data->error_message = g_strdup_printf(_("Error resolving %s:\n%s"),
-					query_data->hostname, tmp);
+			query_data->error_message = g_strdup_printf(_("Error converting %s "
+					"to punycode: %d"), query_data->hostname, rc);
 			/* back to main thread */
 			purple_timeout_add(0, dns_main_thread_cb, query_data);
 			return 0;
@@ -951,6 +950,7 @@
 			g_snprintf(message, sizeof(message), _("Error resolving %s: %d"),
 					query_data->hostname, h_errno);
 			purple_dnsquery_failed(query_data, message);
+			g_free(hostname);
 			return FALSE;
 		}
 		memset(&sin, 0, sizeof(struct sockaddr_in));
--- a/libpurple/protocols/jabber/google.c	Mon Sep 28 17:41:56 2009 +0000
+++ b/libpurple/protocols/jabber/google.c	Tue Sep 29 01:36:03 2009 +0000
@@ -104,7 +104,8 @@
 
 	for (;candidates;candidates = candidates->next) {
 		JabberIq *iq;
-		gchar *ip, *port, *pref, *username, *password;
+		gchar *ip, *port, *username, *password;
+		gchar pref[16];
 		PurpleMediaCandidateType type;
 		xmlnode *sess;
 		xmlnode *candidate;
@@ -123,9 +124,8 @@
 		ip = purple_media_candidate_get_ip(transport);
 		port = g_strdup_printf("%d",
 				purple_media_candidate_get_port(transport));
-		pref = g_strdup_printf("%f",
-				purple_media_candidate_get_priority(transport)
-				/1000.0);
+		g_ascii_dtostr(pref, 16,
+			purple_media_candidate_get_priority(transport) / 1000.0);
 		username = purple_media_candidate_get_username(transport);
 		password = purple_media_candidate_get_password(transport);
 		type = purple_media_candidate_get_candidate_type(transport);
@@ -163,7 +163,6 @@
 
 		g_free(ip);
 		g_free(port);
-		g_free(pref);
 		g_free(username);
 		g_free(password);