[tracker/tracker-1.10] libtracker-data: Clear possible error
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-1.10] libtracker-data: Clear possible error
- Date: Thu, 23 Feb 2017 11:03:10 +0000 (UTC)
commit 3103cbaee9ba2b84e5f719b411cc7d18a4b3694e
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Feb 22 15:02:18 2017 +0100
libtracker-data: Clear possible error
The same GError may be reused further ahead, which would doubly free
it as it gets non-NULL again to error handling paths.
src/libtracker-data/tracker-data-update.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 4ae923e..7c78c24 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -3453,7 +3453,8 @@ tracker_data_rollback_transaction (void)
tracker_db_interface_execute_query (iface, &ignorable, "ROLLBACK");
if (ignorable) {
- g_error_free (ignorable);
+ g_warning ("Transaction rollback failed: %s\n", ignorable->message);
+ g_clear_error (&ignorable);
}
tracker_db_interface_execute_query (iface, NULL, "PRAGMA cache_size = %d",
TRACKER_DB_CACHE_SIZE_DEFAULT);
@@ -3469,7 +3470,7 @@ tracker_data_rollback_transaction (void)
* journal file failing (in case of TRANSACTION_FORMAT_ONTOLOGY) */
g_warning ("Error ignored while rolling back transaction in journal: %s",
ignorable->message ? ignorable->message : "No error given");
- g_error_free (ignorable);
+ g_clear_error (&ignorable);
}
#endif /* DISABLE_JOURNAL */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]