[evolution-data-server/email-factory] e_book_backend_file_get_changes: Fix possible memory leak



commit 9f5024901006ca303a8bf4d1510c0555b9c675d0
Author: Christophe Dumez <christophe dumez intel com>
Date:   Mon May 30 14:16:11 2011 +0300

    e_book_backend_file_get_changes: Fix possible memory leak
    
    Currently, only the list elements were freed. This patch
    makes sure the GLists are freed too.

 addressbook/backends/file/e-book-backend-file.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/addressbook/backends/file/e-book-backend-file.c b/addressbook/backends/file/e-book-backend-file.c
index dd2d8e8..eceb7bc 100644
--- a/addressbook/backends/file/e-book-backend-file.c
+++ b/addressbook/backends/file/e-book-backend-file.c
@@ -868,6 +868,14 @@ e_book_backend_file_get_changes (EBookBackendSync *backend,
 		e_dbhash_write (ehash);
 
 		*changes_out = changes;
+
+		/* Free the lists */
+		g_list_free (ctx.add_ids);
+		g_list_free (ctx.mod_ids);
+		g_list_free (ctx.del_ids);
+		g_list_free (ctx.add_cards);
+		g_list_free (ctx.mod_cards);
+		g_list_free (ctx.del_cards);
 	}
 
 	e_dbhash_destroy (ehash);



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