[tracker] libtracker-data: check pointer before unref
- From: Ivan Frade <ifrade src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-data: check pointer before unref
- Date: Thu, 30 Sep 2010 07:58:18 +0000 (UTC)
commit 34ceeff27313010f7bf405e85e826f4f6f242d82
Author: Ivan Frade <ivan frade nokia com>
Date: Thu Sep 30 10:51:37 2010 +0300
libtracker-data: check pointer before unref
In some situations (file that is not a database) setting the journaling
pragma returns NULL.
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 00a0a1c..495a6b7 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -218,7 +218,9 @@ db_set_params (TrackerDBInterface *iface,
tracker_db_interface_execute_query (iface, NULL, "PRAGMA auto_vacuum = 0;");
result_set = tracker_db_interface_execute_query (iface, NULL, "PRAGMA journal_mode = WAL;");
- g_object_unref (result_set);
+ if (result_set) {
+ g_object_unref (result_set);
+ }
if (page_size != TRACKER_DB_PAGE_SIZE_DONT_SET) {
g_message (" Setting page size to %d", page_size);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]