changeset 20946:2c039a40babc

More leak fixes.
author Daniel Atallah <daniel.atallah@gmail.com>
date Mon, 15 Oct 2007 03:07:16 +0000
parents 4cd97da26150
children 3c4d37b98c31
files libpurple/protocols/msn/httpconn.c libpurple/protocols/msn/switchboard.c
diffstat 2 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/httpconn.c	Mon Oct 15 02:39:07 2007 +0000
+++ b/libpurple/protocols/msn/httpconn.c	Mon Oct 15 03:07:16 2007 +0000
@@ -687,6 +687,17 @@
 
 	g_free(httpconn->host);
 
+	while (httpconn->queue != NULL) {
+		MsnHttpQueueData *queue_data;
+
+		queue_data = (MsnHttpQueueData *) httpconn->queue->data;
+
+		httpconn->queue = g_list_remove_link(httpconn->queue, httpconn->queue);
+
+		g_free(queue_data->body);
+		g_free(queue_data);
+	}
+
 	purple_circ_buffer_destroy(httpconn->tx_buf);
 	if (httpconn->tx_handler > 0)
 		purple_input_remove(httpconn->tx_handler);
--- a/libpurple/protocols/msn/switchboard.c	Mon Oct 15 02:39:07 2007 +0000
+++ b/libpurple/protocols/msn/switchboard.c	Mon Oct 15 03:07:16 2007 +0000
@@ -108,8 +108,8 @@
 	g_free(swboard->auth_key);
 	g_free(swboard->session_id);
 
-	for (l = swboard->users; l != NULL; l = l->next)
-		g_free(l->data);
+	for (; swboard->users; swboard->users = g_list_remove_link(swboard->users, swboard->users))
+		g_free(swboard->users->data);
 
 	session = swboard->session;
 	session->switches = g_list_remove(session->switches, swboard);