[evolution-data-server/treitter-client-gdbus] Fix a nasty e-addressbook-factory crasher based on a double-free.
- From: Travis Reitter <treitter src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [evolution-data-server/treitter-client-gdbus] Fix a nasty e-addressbook-factory crasher based on a double-free.
- Date: Tue, 15 Dec 2009 19:45:54 +0000 (UTC)
commit 100a0f0ba3a4fae09a8ad6b72808e86a7676547e
Author: Travis Reitter <treitter gmail com>
Date: Fri Dec 11 08:25:26 2009 -0800
Fix a nasty e-addressbook-factory crasher based on a double-free.
addressbook/libedata-book/e-data-book-factory.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/addressbook/libedata-book/e-data-book-factory.c b/addressbook/libedata-book/e-data-book-factory.c
index d5e891f..3bd9804 100644
--- a/addressbook/libedata-book/e-data-book-factory.c
+++ b/addressbook/libedata-book/e-data-book-factory.c
@@ -367,11 +367,14 @@ name_owner_changed (DBusGProxy *proxy,
gchar *key;
GList *list = NULL;
g_mutex_lock (factory->priv->connections_lock);
- if (g_hash_table_lookup_extended (factory->priv->connections, prev_owner, (gpointer)&key, (gpointer)&list)) {
- g_list_foreach (list, (GFunc)g_object_unref, NULL);
- g_list_free (list);
- g_hash_table_remove (factory->priv->connections, prev_owner);
+ while (g_hash_table_lookup_extended (factory->priv->connections, prev_owner, (gpointer)&key, (gpointer)&list)) {
+ /* this should trigger the book's weak ref notify
+ * function, which will remove it from the list before
+ * it's freed, and will remove the connection from
+ * priv->connections once they're all gone */
+ g_object_unref (list->data);
}
+
g_mutex_unlock (factory->priv->connections_lock);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]