changeset 28666:4c58aa4aacb0

Minor leak fixes. Probably not too important since they're in DNS resolver child processes.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 28 Sep 2009 01:54:43 +0000
parents 60e4ef6801ff
children 213a3449bb3c
files libpurple/dnsquery.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/dnsquery.c	Sat Sep 26 17:38:05 2009 +0000
+++ b/libpurple/dnsquery.c	Mon Sep 28 01:54:43 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;
@@ -951,6 +953,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));