[evolution-data-server/gnome-3-2] build_sqlitedb: Fix possible memory leak



commit d3b385cb591bb92a5a798eb8cb5cb6178432308c
Author: Christophe Dumez <christophe dumez intel com>
Date:   Sat Oct 8 09:44:55 2011 +0300

    build_sqlitedb: Fix possible memory leak
    
    Memory can get leaked when inserting contacts to the summary
    fails.

 addressbook/backends/file/e-book-backend-file.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/addressbook/backends/file/e-book-backend-file.c b/addressbook/backends/file/e-book-backend-file.c
index 596a902..6f30893 100644
--- a/addressbook/backends/file/e-book-backend-file.c
+++ b/addressbook/backends/file/e-book-backend-file.c
@@ -254,6 +254,8 @@ build_sqlitedb (EBookBackendFilePrivate *bfpriv)
 						   contacts, FALSE, &error)) {
 		g_warning ("Failed to build contact summary: %s", error->message);
 		g_error_free (error);
+		g_slist_foreach (contacts, (GFunc) g_object_unref, NULL);
+		g_slist_free (contacts);
 		return FALSE;
 	}
 



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