changeset 32194:462c19eb31d8

Remove duplicate calls to msn_slpmsg_set_slplink. This function is already called when a slpmsg is created, and calling it again will place the slpmsg on the slplink list an extra time. If the slpmsg is freed, then the first entry is removed, but the second remains, and can cause crashes due to invalid memory accesses. Fixes #14307.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Thu, 14 Jul 2011 05:54:10 +0000
parents 7d08ac041588
children e17b5aab37d0
files ChangeLog libpurple/protocols/msn/slp.c libpurple/protocols/msn/slpcall.c
diffstat 3 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Jul 12 19:49:44 2011 +0000
+++ b/ChangeLog	Thu Jul 14 05:54:10 2011 +0000
@@ -13,6 +13,9 @@
 	* Better status message handling. (Tomasz Wasilczyk) (#14314)
 	* Merged two buddy blocking methods. (Tomasz Wasilczyk) (#5303)
 
+	MSN:
+	* Fix seemingly random crashing. (#14307)
+
 	XMPP:
 	* Do not generate malformed XML ("</>") when setting an empty mood.
 	  (#14342)
--- a/libpurple/protocols/msn/slp.c	Tue Jul 12 19:49:44 2011 +0000
+++ b/libpurple/protocols/msn/slp.c	Thu Jul 14 05:54:10 2011 +0000
@@ -284,7 +284,6 @@
 	purple_xfer_unref(xfer);
 
 	slpmsg = msn_slpmsg_file_new(slpcall, purple_xfer_get_size(xfer));
-	msn_slpmsg_set_slplink(slpmsg, slpcall->slplink);
 
 	msn_slplink_send_slpmsg(slpcall->slplink, slpmsg);
 }
--- a/libpurple/protocols/msn/slpcall.c	Tue Jul 12 19:49:44 2011 +0000
+++ b/libpurple/protocols/msn/slpcall.c	Thu Jul 14 05:54:10 2011 +0000
@@ -490,12 +490,10 @@
 		if (img != NULL) {
 			/* DATA PREP */
 			slpmsg = msn_slpmsg_dataprep_new(slpcall);
-			msn_slpmsg_set_slplink(slpmsg, slplink);
 			msn_slplink_queue_slpmsg(slplink, slpmsg);
 
 			/* DATA */
 			slpmsg = msn_slpmsg_obj_new(slpcall, img);
-			msn_slpmsg_set_slplink(slpmsg, slplink);
 			msn_slplink_queue_slpmsg(slplink, slpmsg);
 			purple_imgstore_unref(img);