[tracker] libtracker-data: Make sure we don't leak sql_dir on multiple _init() calls



commit 98161a9a825167efb377993a61bd2421b1792b53
Author: Martyn Russell <martyn lanedo com>
Date:   Thu Jun 23 14:07:53 2011 +0100

    libtracker-data: Make sure we don't leak sql_dir on multiple _init() calls

 src/libtracker-data/tracker-db-manager.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index 67bec64..583ac5d 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -153,7 +153,7 @@ static void                db_remove_locale_file                    (void);
 
 static gboolean              initialized;
 static gboolean              locations_initialized;
-static gchar                *sql_dir;
+static gchar                *sql_dir = NULL;
 static gchar                *data_dir = NULL;
 static gchar                *user_data_dir = NULL;
 static gchar                *sys_tmp_dir = NULL;
@@ -880,6 +880,7 @@ tracker_db_manager_init (TrackerDBManagerFlags   flags,
 	sys_tmp_dir = g_build_filename (g_get_tmp_dir (), filename, NULL);
 	g_free (filename);
 
+	g_free (sql_dir);
 	env_path = g_getenv ("TRACKER_DB_SQL_DIR");
 
 	if (G_UNLIKELY (!env_path)) {
@@ -1252,6 +1253,7 @@ tracker_db_manager_shutdown (void)
 	g_free (sys_tmp_dir);
 	sys_tmp_dir = NULL;
 	g_free (sql_dir);
+	sql_dir = NULL;
 
 	if (global_iface) {
 		/* libtracker-direct */



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