[evolution-data-server] e_book_backend_file_get_contact_list: Fix memory leak
- From: Patrick Ohly <pohly src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] e_book_backend_file_get_contact_list: Fix memory leak
- Date: Mon, 6 Jun 2011 19:27:13 +0000 (UTC)
commit 4324e0125cbc23c81bd8f1dadcafdd945cf26eb1
Author: Christophe Dumez <christophe dumez intel com>
Date: Mon Jun 6 16:48:42 2011 +0300
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.
addressbook/backends/file/e-book-backend-file.c | 4 ++++
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 87f4180..604c396 100644
--- a/addressbook/backends/file/e-book-backend-file.c
+++ b/addressbook/backends/file/e-book-backend-file.c
@@ -475,7 +475,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_slist_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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]