changeset 31381:ccaa215ad56b

merge of '235da67d85fa24f86f8a6e0b743c070914f23a45' and 'eaeb839d23b9ccd56b6f8b0f9e014d57c273f5bf'
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 21 Nov 2010 10:03:02 +0000
parents 9877f1307a0d (current diff) 8714c0bfa52a (diff)
children 8d0e0ac0bf97 e83879956437
files
diffstat 13 files changed, 31 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/account.c	Sun Nov 21 09:40:48 2010 +0000
+++ b/libpurple/account.c	Sun Nov 21 10:03:02 2010 +0000
@@ -1087,6 +1087,9 @@
 	g_hash_table_destroy(account->settings);
 	g_hash_table_destroy(account->ui_settings);
 
+	if (account->proxy_info)
+		purple_proxy_info_destroy(account->proxy_info);
+
 	purple_account_set_status_types(account, NULL);
 
 	purple_presence_destroy(account->presence);
--- a/libpurple/protocols/msn/directconn.c	Sun Nov 21 09:40:48 2010 +0000
+++ b/libpurple/protocols/msn/directconn.c	Sun Nov 21 10:03:02 2010 +0000
@@ -630,8 +630,11 @@
 
 	case DC_STATE_ESTABLISHED:
 
-		part = msn_slpmsgpart_new_from_data(dc->in_buffer + 4, dc->header.length);
-		msn_slplink_process_msg(dc->slplink, part);
+		if (dc->header.length) {
+			part = msn_slpmsgpart_new_from_data(dc->in_buffer + 4, dc->header.length);
+			msn_slplink_process_msg(dc->slplink, part);
+			msn_slpmsgpart_destroy(part);
+		}
 
 		/*
 		if (dc->num_calls == 0) {
--- a/libpurple/protocols/msn/msg.c	Sun Nov 21 09:40:48 2010 +0000
+++ b/libpurple/protocols/msn/msg.c	Sun Nov 21 10:03:02 2010 +0000
@@ -368,6 +368,8 @@
 
 		memcpy(n, body, siz);
 		n += siz;
+
+		g_free(body);
 	}
 	else
 	{
--- a/libpurple/protocols/msn/msn.c	Sun Nov 21 09:40:48 2010 +0000
+++ b/libpurple/protocols/msn/msn.c	Sun Nov 21 10:03:02 2010 +0000
@@ -1446,6 +1446,7 @@
 	}
 
 	msn_switchboard_send_msg(swboard, msg, TRUE);
+	msn_message_destroy(msg);
 }
 
 static int
@@ -2081,6 +2082,7 @@
 		trans = msn_transaction_new(cmdproc, "PNG", NULL);
 		msn_transaction_set_saveable(trans, FALSE);
 		msn_cmdproc_send_trans(cmdproc, trans);
+		msn_transaction_destroy(trans);
 	}
 }
 
--- a/libpurple/protocols/msn/notification.c	Sun Nov 21 09:40:48 2010 +0000
+++ b/libpurple/protocols/msn/notification.c	Sun Nov 21 10:03:02 2010 +0000
@@ -309,6 +309,7 @@
 	trans = msn_transaction_new(notification->cmdproc, "OUT", NULL);
 	msn_transaction_set_saveable(trans, FALSE);
 	msn_cmdproc_send_trans(notification->cmdproc, trans);
+	msn_transaction_destroy(trans);
 
 	msn_notification_disconnect(notification);
 }
--- a/libpurple/protocols/msn/object.c	Sun Nov 21 09:40:48 2010 +0000
+++ b/libpurple/protocols/msn/object.c	Sun Nov 21 10:03:02 2010 +0000
@@ -202,6 +202,8 @@
 	g_free(obj->friendly);
 	g_free(obj->sha1d);
 	g_free(obj->sha1c);
+	g_free(obj->url);
+	g_free(obj->url1);
 
 	purple_imgstore_unref(obj->img);
 
--- a/libpurple/protocols/msn/sbconn.c	Sun Nov 21 09:40:48 2010 +0000
+++ b/libpurple/protocols/msn/sbconn.c	Sun Nov 21 10:03:02 2010 +0000
@@ -16,10 +16,10 @@
 	passport = purple_normalize(slplink->session->account, slplink->remote_user);
 	msn_message_set_header(msg, "P2P-Dest", passport);
 
+	msg->part = msn_slpmsgpart_ref(part);
 	data = msn_slpmsgpart_serialize(part, &size);
-	msg->part = msn_slpmsgpart_ref(part);
-
 	msn_message_set_bin_data(msg, data, size);
+	g_free(data);
 
 	if (slplink->swboard == NULL)
 	{
@@ -33,6 +33,7 @@
 	}
 
 	msn_switchboard_send_msg(slplink->swboard, msg, TRUE);
+	msn_message_destroy(msg);
 }
 
 /** Called when a message times out. */
--- a/libpurple/protocols/msn/slpcall.c	Sun Nov 21 09:40:48 2010 +0000
+++ b/libpurple/protocols/msn/slpcall.c	Sun Nov 21 10:03:02 2010 +0000
@@ -826,6 +826,7 @@
 
 		/* Try direct file transfer by sending a second INVITE */
 		dc = msn_dc_new(slpcall);
+		g_free(slpcall->branch);
 		slpcall->branch = rand_guid();
 
 		dc->listen_data = purple_network_listen_range(
--- a/libpurple/protocols/msn/slplink.c	Sun Nov 21 09:40:48 2010 +0000
+++ b/libpurple/protocols/msn/slplink.c	Sun Nov 21 10:03:02 2010 +0000
@@ -502,7 +502,6 @@
 	slpcall = msn_slp_process_msg(slplink, slpmsg);
 
 	if (slpcall == NULL) {
-		msn_slpmsg_destroy(slpmsg);
 		return;
 	}
 
@@ -541,8 +540,6 @@
 		}
 	}
 
-	msn_slpmsg_destroy(slpmsg);
-
 	if (!slpcall->wait_for_socket && slpcall->wasted)
 		msn_slpcall_destroy(slpcall);
 }
@@ -625,6 +622,8 @@
 	/* All the pieces of the slpmsg have been received */
 	if (header->offset + header->length >= header->total_size)
 		process_complete_msg(slplink, slpmsg, header);
+
+	msn_slpmsg_destroy(slpmsg);
 }
 
 void
--- a/libpurple/protocols/msn/slpmsg.c	Sun Nov 21 09:40:48 2010 +0000
+++ b/libpurple/protocols/msn/slpmsg.c	Sun Nov 21 10:03:02 2010 +0000
@@ -326,6 +326,9 @@
 
 	*ret_size = tmp - base;
 
+	g_free(header);
+	g_free(footer);
+
 	return base;
 }
 
--- a/libpurple/protocols/msn/slpmsg_part.c	Sun Nov 21 09:40:48 2010 +0000
+++ b/libpurple/protocols/msn/slpmsg_part.c	Sun Nov 21 10:03:02 2010 +0000
@@ -109,8 +109,7 @@
 {
 	g_return_if_fail(part != NULL);
 
-	if (part->buffer != NULL)
-		g_free(part->buffer);
+	g_free(part->buffer);
 
 	if (data != NULL && len > 0) {
 		part->buffer = g_malloc(len + 1);
@@ -154,6 +153,9 @@
 
 	*ret_size = tmp - base;
 
+	g_free(header);
+	g_free(footer);
+
 	return base;
 }
 /* We have received the message ack */
--- a/libpurple/protocols/msn/switchboard.c	Sun Nov 21 09:40:48 2010 +0000
+++ b/libpurple/protocols/msn/switchboard.c	Sun Nov 21 10:03:02 2010 +0000
@@ -1147,6 +1147,7 @@
 		trans = msn_transaction_new(cmdproc, "OUT", NULL);
 		msn_transaction_set_saveable(trans, FALSE);
 		msn_cmdproc_send_trans(cmdproc, trans);
+		msn_transaction_destroy(trans);
 
 		msn_switchboard_destroy(swboard);
 	}
--- a/libpurple/protocols/msn/transaction.c	Sun Nov 21 09:40:48 2010 +0000
+++ b/libpurple/protocols/msn/transaction.c	Sun Nov 21 10:03:02 2010 +0000
@@ -220,10 +220,11 @@
 	purple_debug_info("msn", "timed out: %s %d %s\n", trans->command, trans->trId, trans->params);
 #endif
 
+	trans->timer = 0;
+
 	if (trans->timeout_cb != NULL)
 		trans->timeout_cb(trans->cmdproc, trans);
 
-	trans->timer = 0;
 	return FALSE;
 }