[tracker/initable-db-iface] libtracker-data: Fix memory leak in case of error
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/initable-db-iface] libtracker-data: Fix memory leak in case of error
- Date: Thu, 3 Feb 2011 13:10:19 +0000 (UTC)
commit 1615dfd3fab8c3e4f10d3d14cd2848b5a62dead1
Author: Philip Van Hoof <philip codeminded be>
Date: Thu Feb 3 14:09:55 2011 +0100
libtracker-data: Fix memory leak in case of error
src/libtracker-data/tracker-db-manager.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index 1a73266..2997b50 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -892,10 +892,18 @@ tracker_db_manager_init (TrackerDBManagerFlags flags,
g_message ("One or more database files are missing, a reindex will be forced");
need_reindex = TRUE;
} else {
+ guint y;
+
g_set_error (error,
TRACKER_DB_INTERFACE_ERROR,
TRACKER_DB_OPEN_ERROR,
"Could not find database file:'%s'. One or more database files are missing", dbs[i].abs_filename);
+
+ for (y = 0; y < i - 1; y++) {
+ g_free (dbs[y].abs_filename);
+ dbs[y].abs_filename = NULL;
+ }
+
return FALSE;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]