changeset 23677:331effbd1cc8

Re-arrange msn_slplink_destroy and msn_slp_call_destroy. Might help avoid use-after-free in slp.c got_emoticon and got_user_display.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 08 Aug 2008 04:47:50 +0000
parents 8552b19acbce
children 8ba3d6905252
files libpurple/protocols/msn/slpcall.c libpurple/protocols/msn/slplink.c
diffstat 2 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/slpcall.c	Fri Aug 08 03:34:28 2008 +0000
+++ b/libpurple/protocols/msn/slpcall.c	Fri Aug 08 04:47:50 2008 +0000
@@ -70,10 +70,6 @@
 	if (slpcall->timer)
 		purple_timeout_remove(slpcall->timer);
 
-	g_free(slpcall->id);
-	g_free(slpcall->branch);
-	g_free(slpcall->data_info);
-
 	for (e = slpcall->slplink->slp_msgs; e != NULL; )
 	{
 		MsnSlpMessage *slpmsg = e->data;
@@ -100,6 +96,10 @@
 	if (slpcall->xfer != NULL)
 		purple_xfer_unref(slpcall->xfer);
 
+	g_free(slpcall->id);
+	g_free(slpcall->branch);
+	g_free(slpcall->data_info);
+
 	g_free(slpcall);
 }
 
--- a/libpurple/protocols/msn/slplink.c	Fri Aug 08 03:34:28 2008 +0000
+++ b/libpurple/protocols/msn/slplink.c	Fri Aug 08 04:47:50 2008 +0000
@@ -101,9 +101,6 @@
 
 	session = slplink->session;
 
-	g_free(slplink->local_user);
-	g_free(slplink->remote_user);
-
 #if 0
 	if (slplink->directconn != NULL)
 		msn_directconn_destroy(slplink->directconn);
@@ -117,6 +114,9 @@
 	session->slplinks =
 		g_list_remove(session->slplinks, slplink);
 
+	g_free(slplink->local_user);
+	g_free(slplink->remote_user);
+
 	g_free(slplink);
 }