changeset 23559:3ba2cddc49f0

Fix a double free when connecting to the sender of a bonjour file fails. Also plug a small leak. Fixes #5971. (this time only commit the one file instead of my whole tree)
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 17 Jul 2008 04:53:32 +0000
parents 05d3447fb34e
children aade89b06762
files libpurple/protocols/bonjour/bonjour_ft.c
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/bonjour/bonjour_ft.c	Thu Jul 17 04:49:35 2008 +0000
+++ b/libpurple/protocols/bonjour/bonjour_ft.c	Thu Jul 17 04:53:32 2008 +0000
@@ -300,6 +300,8 @@
 		}
 		if (xf->proxy_connection != NULL)
 			purple_proxy_connect_cancel(xf->proxy_connection);
+		if (xf->proxy_info != NULL)
+			purple_proxy_info_destroy(xf->proxy_info);
 		if (xf->listen_data != NULL)
 			purple_network_listen_cancel(xf->listen_data);
 		g_free(xf->iq_id);
@@ -802,6 +804,8 @@
 	xmlnode *q_node, *tmp_node;
 	BonjourData *bd;
 
+	xf->proxy_connection = NULL;
+
 	if(source < 0) {
 		purple_debug_error("bonjour", "Error connecting via SOCKS5 - %s\n",
 			error_message ? error_message : "(null)");
@@ -815,9 +819,6 @@
 
 	bd = xf->data;
 
-	purple_proxy_info_destroy(xf->proxy_info);
-	xf->proxy_connection = NULL;
-	xf->proxy_info = NULL;
 	/* Here, start the file transfer.*/
 
 	/* Notify Initiator of Connection */
@@ -871,8 +872,6 @@
 		xep_ft_si_reject(xf->data, xf->iq_id, xfer->who, "404", "cancel");
 		/* Cancel the connection */
 		purple_xfer_cancel_local(xfer);
-		/*purple_proxy_info_destroy(xf->proxy_info);
-		xf->proxy_info = NULL;*/
 	}
 }