[gnome-builder/gnome-builder-3-26] git: consistently use g_steal_pointer() for errors
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-26] git: consistently use g_steal_pointer() for errors
- Date: Wed, 1 Nov 2017 19:28:13 +0000 (UTC)
commit 45994e54c984d79dbe5a894b4f39d86ace6980db
Author: Christian Hergert <chergert redhat com>
Date: Wed Oct 18 14:23:00 2017 -0700
git: consistently use g_steal_pointer() for errors
This fixes a double free that can happen because we failed to
steal the pointer when changing to g_autoptr(GError).
plugins/git/ide-git-vcs.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/plugins/git/ide-git-vcs.c b/plugins/git/ide-git-vcs.c
index f3e2993..c619125 100644
--- a/plugins/git/ide-git-vcs.c
+++ b/plugins/git/ide-git-vcs.c
@@ -363,7 +363,7 @@ ide_git_vcs_reload_worker (GTask *task,
!(repository2 = ide_git_vcs_load (self, &error)))
{
g_debug ("%s", error->message);
- g_task_return_error (task, error);
+ g_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
@@ -610,13 +610,13 @@ ide_git_vcs_init_async__reload_cb (GObject *object,
{
IdeGitVcs *self = (IdeGitVcs *)object;
g_autoptr(GTask) task = user_data;
- GError *error = NULL;
+ g_autoptr(GError) error = NULL;
g_assert (G_IS_TASK (task));
g_assert (IDE_IS_GIT_VCS (self));
if (!ide_git_vcs_reload_finish (self, result, &error))
- g_task_return_error (task, error);
+ g_task_return_error (task, g_steal_pointer (&error));
else
g_task_return_boolean (task, TRUE);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]