[tracker/wal: 3/3] libtracker-data: remove all null checks before g_free() in db-manager



commit fdb34975efa0f3bec7bf702a5f2bfb9638879fdd
Author: Martyn Russell <martyn lanedo com>
Date:   Thu Jul 22 17:29:22 2010 +0100

    libtracker-data: remove all null checks before g_free() in db-manager

 src/libtracker-data/tracker-db-manager.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index 0ec2db8..7b19ad2 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -622,8 +622,7 @@ tracker_db_manager_init (TrackerDBManagerFlags  flags,
 	old_flags = flags;
 
 	filename = g_strdup_printf ("tracker-%s", g_get_user_name ());
-	if (sys_tmp_dir)
-		g_free (sys_tmp_dir);
+        g_free (sys_tmp_dir);
 	sys_tmp_dir = g_build_filename (g_get_tmp_dir (), filename, NULL);
 	g_free (filename);
 
@@ -637,17 +636,13 @@ tracker_db_manager_init (TrackerDBManagerFlags  flags,
 		sql_dir = g_strdup (env_path);
 	}
 
-	if (user_data_dir)
-		g_free (user_data_dir);
-
+        g_free (user_data_dir);
 	user_data_dir = g_build_filename (g_get_user_data_dir (),
 	                                  "tracker",
 	                                  "data",
 	                                  NULL);
 
-	if (data_dir)
-		g_free (data_dir);
-
+	g_free (data_dir);
 	data_dir = g_build_filename (g_get_user_cache_dir (),
 	                             "tracker",
 	                             NULL);
@@ -686,8 +681,8 @@ tracker_db_manager_init (TrackerDBManagerFlags  flags,
 	for (i = 1; i < G_N_ELEMENTS (dbs); i++) {
 		/* Fill absolute path for the database */
 		dir = location_to_directory (dbs[i].location);
-		if (dbs[i].abs_filename)
-			g_free (dbs[i].abs_filename);
+
+                g_free (dbs[i].abs_filename);
 		dbs[i].abs_filename = g_build_filename (dir, dbs[i].file, NULL);
 
 		/* Check we have each database in place, if one is



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