diff src/protocols/msn/switchboard.c @ 10284:f776e117c17b

[gaim-migrate @ 11454] Several MSN memory leaks identified and fixed by Miah Gregory and Felipe Contreras, plus my own fix for bug 1075347. As normal, thank them for fixes, blame me for breakages. Did I mention the new MSN icon? It rocks! committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Wed, 01 Dec 2004 02:30:47 +0000
parents b4dc55d994bf
children 56cc5d49472b
line wrap: on
line diff
--- a/src/protocols/msn/switchboard.c	Wed Dec 01 01:17:46 2004 +0000
+++ b/src/protocols/msn/switchboard.c	Wed Dec 01 02:30:47 2004 +0000
@@ -280,6 +280,9 @@
 	msn_message_parse_payload(msg, payload, len);
 	/* msn_message_show_readable(msg, "SB RECV", FALSE); */
 
+	if (msg->remote_user != NULL)
+		g_free (msg->remote_user);
+
 	msg->remote_user = g_strdup(cmd->params[0]);
 	msn_cmdproc_process_msg(cmdproc, msg);
 
@@ -526,7 +529,9 @@
 
 	msg = cmd->trans->data;
 
-	msg->ack_cb (msg->ack_data);
+	msg->ack_cb(msg->ack_data);
+
+	msn_message_unref(msg);
 }
 
 void
@@ -551,6 +556,7 @@
 
 	/* Data for callbacks */
 	msn_transaction_set_data(trans, msg);
+	msn_message_ref(msg);
 
 	if (msg->ack_cb != NULL)
 	{