aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/backend')
-rw-r--r--addressbook/backend/pas/pas-backend-file.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c
index e9086aa1ff..4f0b54dc61 100644
--- a/addressbook/backend/pas/pas-backend-file.c
+++ b/addressbook/backend/pas/pas-backend-file.c
@@ -275,6 +275,8 @@ compare_category (ECardSimple *card, const char *str,
EList *categories;
EIterator *iterator;
ECard *ecard;
+ gboolean ret_val = FALSE;
+
gtk_object_get (GTK_OBJECT (card),
"card", &ecard,
NULL);
@@ -285,11 +287,15 @@ compare_category (ECardSimple *card, const char *str,
for (iterator = e_list_get_iterator(categories); e_iterator_is_valid (iterator); e_iterator_next (iterator)) {
const char *category = e_iterator_get (iterator);
- if (compare(category, str))
- return TRUE;
+ if (compare(category, str)) {
+ ret_val = TRUE;
+ break;
+ }
}
- return FALSE;
+ gtk_object_unref (GTK_OBJECT (iterator));
+ e_card_free_empty_lists (ecard);
+ return ret_val;
}
static struct prop_info {