changeset 10305:9bfcb5eb12bd

[gaim-migrate @ 11490] Remove what was apparently the only goto in Gaim. I almost didn't do this because this is probably Syd Logan's last few lines of code, or something. Eh. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 03 Dec 2004 00:10:19 +0000
parents 842c424078a3
children 56cc5d49472b
files COPYRIGHT src/proxy.c
diffstat 2 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/COPYRIGHT	Fri Dec 03 00:01:31 2004 +0000
+++ b/COPYRIGHT	Fri Dec 03 00:10:19 2004 +0000
@@ -95,6 +95,7 @@
 Nicolas Lichtmaier
 Artem Litvinovich
 Syd Logan
+Norberto Lopes
 Uli Luckas
 Matthew Luckie
 Mike Lundy
--- a/src/proxy.c	Fri Dec 03 00:01:31 2004 +0000
+++ b/src/proxy.c	Fri Dec 03 00:10:19 2004 +0000
@@ -636,7 +636,7 @@
 
 /* Note: The below win32 implementation is actually platform independent.
    Perhaps this can be used in place of the above platform dependent code.
-*/ 
+*/
 
 typedef struct _dns_tdata {
 	char *hostname;
@@ -660,8 +660,12 @@
 	dns_tdata *td = (dns_tdata*)data;
 	struct hostent *hp;
 
-	if(!(hp = gethostbyname(td->hostname)))
-		goto failure;
+	if(!(hp = gethostbyname(td->hostname))) {
+		g_free(td->hostname);
+		g_free(td);
+		return 0;
+	}
+
 	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;
@@ -672,11 +676,7 @@
 	/* back to main thread */
 	g_idle_add(dns_main_thread_cb, td);
 	return 0;
- failure:
-	g_free(td->hostname);
-	g_free(td);
-	return 0;
-} 
+}
 
 int gaim_gethostbyname_async(const char *hostname, int port,
 							  dns_callback_t callback, gpointer data) {