[evolution-patches] Patch to fix large memory leak in addressbook



Hi,

The address book backend suffers from quite a nasty memory leak which
means that in normal use the berkley addressbook backend will leak
contacts left, right, and centre.

The attached patch is wonderfully trivial and fixes the leaks.

Ross
-- 
Ross Burton                                 mail: ross burtonini com
                                          jabber: ross burtonini com
                                     www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF

Index: addressbook/backends/file/e-book-backend-file.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/backends/file/e-book-backend-file.c,v
retrieving revision 1.31
diff -u -r1.31 e-book-backend-file.c
--- addressbook/backends/file/e-book-backend-file.c	26 Apr 2005 08:56:58 -0000	1.31
+++ addressbook/backends/file/e-book-backend-file.c	13 May 2005 14:40:34 -0000
@@ -128,6 +128,8 @@
 		db_error = dbc->c_get(dbc, &id_dbt, &vcard_dbt, DB_NEXT);
 
 	}
+
+	dbc->c_close (dbc);
 }
 
 static char *
@@ -450,6 +452,11 @@
 		status = db_error != DB_NOTFOUND
 			? GNOME_Evolution_Addressbook_OtherError
 			: GNOME_Evolution_Addressbook_Success;
+
+		db_error = dbc->c_close(dbc);
+		if (db_error != 0) {
+			g_warning("Could not close cursor: %d", db_error);
+		}
 	}
 
 	*contacts = contact_list;


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