changeset 20987:0cbfc19e4909

Fix some leaks caused by misuse of g_list_remove_link() instead of g_list_delete_link().
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 18 Oct 2007 20:20:57 +0000
parents 12753bdeaf47
children 9375e1a9a196
files libpurple/notify.c libpurple/protocols/msn/httpconn.c libpurple/protocols/msn/switchboard.c libpurple/protocols/msn/user.c pidgin/gtkimhtml.c
diffstat 5 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/notify.c	Thu Oct 18 18:13:30 2007 +0000
+++ b/libpurple/notify.c	Thu Oct 18 20:20:57 2007 +0000
@@ -691,7 +691,7 @@
 	GList *last = g_list_last(user_info->user_info_entries);
 	if (last) {
 		purple_notify_user_info_entry_destroy(last->data);
-		user_info->user_info_entries = g_list_remove_link(user_info->user_info_entries, last);
+		user_info->user_info_entries = g_list_delete_link(user_info->user_info_entries, last);
 	}
 }
 
--- a/libpurple/protocols/msn/httpconn.c	Thu Oct 18 18:13:30 2007 +0000
+++ b/libpurple/protocols/msn/httpconn.c	Thu Oct 18 20:20:57 2007 +0000
@@ -692,7 +692,7 @@
 
 		queue_data = (MsnHttpQueueData *) httpconn->queue->data;
 
-		httpconn->queue = g_list_remove_link(httpconn->queue, httpconn->queue);
+		httpconn->queue = g_list_delete_link(httpconn->queue, httpconn->queue);
 
 		g_free(queue_data->body);
 		g_free(queue_data);
--- a/libpurple/protocols/msn/switchboard.c	Thu Oct 18 18:13:30 2007 +0000
+++ b/libpurple/protocols/msn/switchboard.c	Thu Oct 18 20:20:57 2007 +0000
@@ -108,7 +108,7 @@
 	g_free(swboard->auth_key);
 	g_free(swboard->session_id);
 
-	for (; swboard->users; swboard->users = g_list_remove_link(swboard->users, swboard->users))
+	for (; swboard->users; swboard->users = g_list_delete_link(swboard->users, swboard->users))
 		g_free(swboard->users->data);
 
 	session = swboard->session;
@@ -735,10 +735,9 @@
 	msn_message_show_readable(msg, "SB RECV", FALSE);
 #endif
 
-	if (msg->remote_user != NULL)
-		g_free (msg->remote_user);
+	g_free (msg->remote_user);
+	msg->remote_user = g_strdup(cmd->params[0]);
 
-	msg->remote_user = g_strdup(cmd->params[0]);
 	msn_cmdproc_process_msg(cmdproc, msg);
 
 	msn_message_destroy(msg);
--- a/libpurple/protocols/msn/user.c	Thu Oct 18 18:13:30 2007 +0000
+++ b/libpurple/protocols/msn/user.c	Thu Oct 18 20:20:57 2007 +0000
@@ -383,7 +383,7 @@
 		return;
 
 	g_free(l->data);
-	user->group_ids = g_list_remove_link(user->group_ids, l);
+	user->group_ids = g_list_delete_link(user->group_ids, l);
 }
 
 void
--- a/pidgin/gtkimhtml.c	Thu Oct 18 18:13:30 2007 +0000
+++ b/pidgin/gtkimhtml.c	Thu Oct 18 20:20:57 2007 +0000
@@ -3131,9 +3131,10 @@
 		gtk_text_buffer_get_iter_at_mark(imhtml->text_buffer,
 			&i, sd->mark);
 		if (gtk_text_iter_in_range(&i, start, end)) {
-			GtkIMHtmlScalable *scale = sd->scalable;
+			GtkIMHtmlScalable *scale = GTK_IMHTML_SCALABLE(sd->scalable);
 			scale->free(scale);
-			imhtml->scalables = g_list_remove_link(imhtml->scalables, l);
+			g_free(sd);
+			imhtml->scalables = g_list_delete_link(imhtml->scalables, l);
 		}
 		l = next;
 	}