diff --git a/src/calls-record-store.c b/src/calls-record-store.c index 73153a3..d9e5e3d 100644 --- a/src/calls-record-store.c +++ b/src/calls-record-store.c @@ -87,7 +87,7 @@ load_calls_fetch_cb (GomResourceGroup *group, CallsRecordStore *self) { gboolean ok; - GError *error = NULL; + g_autoptr (GError) error = NULL; guint count, i; gpointer *records; @@ -98,7 +98,6 @@ load_calls_fetch_cb (GomResourceGroup *group, { g_debug ("Error fetching call records: %s", error->message); - g_error_free (error); return; } g_assert (ok); @@ -147,7 +146,7 @@ load_calls_find_cb (GomRepository *repository, CallsRecordStore *self) { GomResourceGroup *group; - GError *error = NULL; + g_autoptr (GError) error = NULL; guint count; group = gom_repository_find_finish (repository, @@ -157,7 +156,6 @@ load_calls_find_cb (GomRepository *repository, { g_debug ("Error finding call records in database `%s': %s", self->filename, error->message); - g_error_free (error); return; } g_assert (group != NULL); @@ -213,7 +211,7 @@ set_up_repo_migrate_cb (GomRepository *repo, GAsyncResult *res, CallsRecordStore *self) { - GError *error = NULL; + g_autoptr (GError) error = NULL; gboolean ok; ok = gom_repository_automatic_migrate_finish (repo, res, &error); @@ -223,7 +221,6 @@ set_up_repo_migrate_cb (GomRepository *repo, { g_warning ("Error migrating call record database `%s': %s", self->filename, error->message); - g_error_free (error); } else { @@ -277,7 +274,7 @@ set_up_repo (CallsRecordStore *self) static void close_adapter (CallsRecordStore *self) { - GError *error = NULL; + g_autoptr (GError) error = NULL; gboolean ok; if (!self->adapter) @@ -292,7 +289,6 @@ close_adapter (CallsRecordStore *self) { g_warning ("Error closing call record database `%s': %s", self->filename, error->message); - g_error_free (error); } else { @@ -310,7 +306,7 @@ open_repo_adapter_open_cb (GomAdapter *adapter, GAsyncResult *res, CallsRecordStore *self) { - GError *error = NULL; + g_autoptr (GError) error = NULL; gboolean ok; ok = gom_adapter_open_finish (adapter, res, &error); @@ -320,7 +316,6 @@ open_repo_adapter_open_cb (GomAdapter *adapter, { g_warning ("Error opening call record database `%s': %s", self->filename, error->message); - g_error_free (error); } else { @@ -388,7 +383,7 @@ record_call_save_cb (GomResource *resource, struct CallsRecordCallData *data) { GObject * const call_obj = G_OBJECT (data->call); - GError *error = NULL; + g_autoptr (GError) error = NULL; gboolean ok; ok = gom_resource_save_finish (resource, res, &error); @@ -398,7 +393,6 @@ record_call_save_cb (GomResource *resource, { g_warning ("Error saving call record to database: %s", error->message); - g_error_free (error); } else { @@ -463,7 +457,7 @@ update_cb (GomResource *resource, GAsyncResult *res, gpointer *unused) { - GError *error = NULL; + g_autoptr (GError) error = NULL; gboolean ok; ok = gom_resource_save_finish (resource, res, &error); @@ -473,7 +467,6 @@ update_cb (GomResource *resource, { g_warning ("Error updating call record in database: %s", error->message); - g_error_free (error); } else {