[tracker/wal: 18/18] libtracker-data: remove all null checks before g_free() in db-manager
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wal: 18/18] libtracker-data: remove all null checks before g_free() in db-manager
- Date: Fri, 13 Aug 2010 15:52:08 +0000 (UTC)
commit b919e1cfabb1c1c517e66f1fb306d1810cf157a3
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 9bbaf26..cbcdd3e 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -624,8 +624,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);
@@ -639,17 +638,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);
@@ -688,8 +683,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]