/pidgin/main: 7f04b505b972: Fix use-after-free in gtkblist

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Wed Mar 20 15:54:41 EDT 2013


Changeset: 7f04b505b9727bd4f4945d915547583e873f16ed
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2013-03-20 20:54 +0100
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/7f04b505b972

Description:

Fix use-after-free in gtkblist

diffstat:

 pidgin/gtkblist.c |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (38 lines):

diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c
--- a/pidgin/gtkblist.c
+++ b/pidgin/gtkblist.c
@@ -123,6 +123,8 @@ typedef struct
 
 	PidginBlistTheme *current_theme;
 
+	guint select_notebook_page_timeout;
+
 #if !GTK_CHECK_VERSION(3,0,0)
 	GdkCursor *hand_cursor;         /**< Hand cursor */
 	GdkCursor *arrow_cursor;        /**< Arrow cursor */
@@ -5033,12 +5035,15 @@ static gboolean pidgin_blist_select_note
 	} else
 		gtk_notebook_set_current_page(GTK_NOTEBOOK(gtkblist->notebook), 0);
 
+	priv->select_notebook_page_timeout = 0;
 	return FALSE;
 }
 
 static void pidgin_blist_select_notebook_page(PidginBuddyList *gtkblist)
 {
-	purple_timeout_add(0, pidgin_blist_select_notebook_page_cb, gtkblist);
+	PidginBuddyListPrivate *priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist);
+	priv->select_notebook_page_timeout = purple_timeout_add(0,
+		pidgin_blist_select_notebook_page_cb, gtkblist);
 }
 
 static void account_modified(PurpleAccount *account, PidginBuddyList *gtkblist)
@@ -7132,6 +7137,8 @@ static void pidgin_blist_destroy(PurpleB
 
 	if (priv->current_theme)
 		g_object_unref(priv->current_theme);
+	if (priv->select_notebook_page_timeout)
+		purple_timeout_remove(priv->select_notebook_page_timeout);
 	g_free(priv);
 
 	g_free(gtkblist);



More information about the Commits mailing list