summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Dumez <christophe.dumez@intel.com>2011-06-06 16:48:42 +0300
committerPatrick Ohly <patrick.ohly@intel.com>2011-06-07 10:53:08 +0200
commit246fb4ca8d6836f97468c4a61e7a535ab771b805 (patch)
tree80ee703b319b33baae8d0552a50d436e221a5fda
parent46db6a3212e60e3754f645e136bf0824438c047d (diff)
downloadevolution-data-server-246fb4ca8d6836f97468c4a61e7a535ab771b805.tar.gz
e_book_backend_file_get_contact_list: Fix memory leak
vcard_dbt.data should be freed if it is not appended to the contact list otherwise memory gets leaked. (Adapted from commit 4324e0125cbc23c81bd8f1dadcafdd945cf26eb1)
-rw-r--r--addressbook/backends/file/e-book-backend-file.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/addressbook/backends/file/e-book-backend-file.c b/addressbook/backends/file/e-book-backend-file.c
index d977a2ec9..b2bd82161 100644
--- a/addressbook/backends/file/e-book-backend-file.c
+++ b/addressbook/backends/file/e-book-backend-file.c
@@ -476,7 +476,11 @@ e_book_backend_file_get_contact_list (EBookBackendSync *backend,
if ((!search_needed) || (card_sexp != NULL && e_book_backend_sexp_match_vcard (card_sexp, vcard_dbt.data))) {
contact_list = g_list_prepend (contact_list, vcard_dbt.data);
+ } else {
+ free (vcard_dbt.data);
}
+ } else {
+ free (vcard_dbt.data);
}
db_error = dbc->c_get (dbc, &id_dbt, &vcard_dbt, DB_NEXT);