pidgin: e935afc9: Fix a double free when connecting to the...

datallah at pidgin.im datallah at pidgin.im
Thu Jul 17 00:55:46 EDT 2008


-----------------------------------------------------------------
Revision: e935afc929a5049cfa89072e6e9dd8e3ab0afa54
Ancestor: 3e94f2878acde962711bfd55e47936c9dbf0f0bc
Author: datallah at pidgin.im
Date: 2008-07-17T04:53:32
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/e935afc929a5049cfa89072e6e9dd8e3ab0afa54

Modified files:
        libpurple/protocols/bonjour/bonjour_ft.c

ChangeLog: 

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)

-------------- next part --------------
============================================================
--- libpurple/protocols/bonjour/bonjour_ft.c	439cfd8cee245794161314b1b15f672467c1d4dd
+++ libpurple/protocols/bonjour/bonjour_ft.c	8e1d6d186c47acd0e97dde10d8428d53a87f77fc
@@ -300,6 +300,8 @@ bonjour_free_xfer(PurpleXfer *xfer)
 		}
 		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 @@ bonjour_bytestreams_connect_cb(gpointer 
 	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 @@ bonjour_bytestreams_connect_cb(gpointer 
 
 	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 @@ bonjour_bytestreams_connect(PurpleXfer *
 		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;*/
 	}
 }
 


More information about the Commits mailing list