[gnome-keyring: 7/12] gcr: Fix null pointer dereference when finalizing GcrCollectionModel



commit 82088d3d8eff24d01b8051501632222284c68e44
Author: Stef Walter <stefw collabora co uk>
Date:   Wed Sep 7 16:14:08 2011 +0200

    gcr: Fix null pointer dereference when finalizing GcrCollectionModel

 gcr/gcr-collection-model.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gcr/gcr-collection-model.c b/gcr/gcr-collection-model.c
index 78b2221..e46bf51 100644
--- a/gcr/gcr-collection-model.c
+++ b/gcr/gcr-collection-model.c
@@ -1200,10 +1200,11 @@ gcr_collection_model_finalize (GObject *object)
 	g_assert (g_hash_table_size (self->pv->object_to_seq) == 0);
 	g_hash_table_destroy (self->pv->object_to_seq);
 
-	g_assert (g_hash_table_size (self->pv->selected) == 0);
-	if (self->pv->selected)
+	if (self->pv->selected) {
+		g_assert (g_hash_table_size (self->pv->selected) == 0);
 		g_hash_table_destroy (self->pv->selected);
-	self->pv->selected = NULL;
+		self->pv->selected = NULL;
+	}
 
 	self->pv->columns = NULL;
 	for (i = 0; i < self->pv->n_columns; i++)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]