pidgin: 43ee5605: Free the DNS query data before purple_ur...

paul at darkrain42.org paul at darkrain42.org
Sun Apr 12 18:50:36 EDT 2009


-----------------------------------------------------------------
Revision: 43ee56055c39a2e7e6c6198de2c553b476a1b782
Ancestor: 0d90d40301d79df2eff00f05778ed05b29a51d6d
Author: paul at darkrain42.org
Date: 2009-04-12T22:25:56
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/43ee56055c39a2e7e6c6198de2c553b476a1b782

Modified files:
        libpurple/protocols/yahoo/yahoo_filexfer.c

ChangeLog: 

Free the DNS query data before purple_url_parse() to avoid leaking on failure.

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/yahoo_filexfer.c	139507baec69e2ced4ed3450349bbefc70f5ff7d
+++ libpurple/protocols/yahoo/yahoo_filexfer.c	b75f4386484aef539fb88b23d44b503f26e27224
@@ -1029,12 +1029,7 @@ static void yahoo_xfer_dns_connected_15(
 		xd->port = YAHOO_XFER_RELAY_PORT;
 
 	url = g_strdup_printf("%ld.%ld.%ld.%ld", d, c, b, a);
-	if (!purple_url_parse(url, &(xd->host), &(xd->port), &(xd->path), NULL, NULL)) {
-		purple_xfer_cancel_remote(xfer);
-		g_free(url);
-		return;
-	}
-	g_free(url);
+
 	/* Free the address... */
 	g_free(hosts->data);
 	hosts = g_slist_remove(hosts, hosts->data);
@@ -1048,6 +1043,13 @@ static void yahoo_xfer_dns_connected_15(
 		hosts = g_slist_remove(hosts, hosts->data);
 	}
 
+	if (!purple_url_parse(url, &(xd->host), &(xd->port), &(xd->path), NULL, NULL)) {
+		purple_xfer_cancel_remote(xfer);
+		g_free(url);
+		return;
+	}
+	g_free(url);
+
 	pkt = yahoo_packet_new(YAHOO_SERVICE_FILETRANS_INFO_15, YAHOO_STATUS_AVAILABLE, yd->session_id);
 	filename = g_path_get_basename(purple_xfer_get_local_filename(xfer));
 


More information about the Commits mailing list