summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorBarnabás Pőcze <pobrn@protonmail.com>2022-10-19 19:42:27 +0200
committerBarnabás Pőcze <pobrn@protonmail.com>2022-10-19 19:52:21 +0200
commitf00fd653cb7b8bc33cc84615b1c75ff878c847b0 (patch)
tree0d986fb574c32f34e5dd900d00ab1a089b52868a /shell
parent1b4b6200a51029a712364a8097c4dd87339f8d39 (diff)
downloadgnome-control-center-f00fd653cb7b8bc33cc84615b1c75ff878c847b0.tar.gz
object-cache: Avoid use after free of task error
The error should not be touched after passing it to `g_task_return_error()` as noted by its documentation: Note that since the task takes ownership of @error, and since the task may be completed before returning from g_task_return_error(), you cannot assume that @error is still valid after calling this. However, previously, the code did try to free error since the `local_error` was defined with `g_autoptr(GError)`.
Diffstat (limited to 'shell')
-rw-r--r--shell/cc-object-storage.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/cc-object-storage.c b/shell/cc-object-storage.c
index f52ba5960..f9a08f3ab 100644
--- a/shell/cc-object-storage.c
+++ b/shell/cc-object-storage.c
@@ -91,7 +91,7 @@ create_dbus_proxy_in_thread_cb (GTask *task,
if (local_error)
{
- g_task_return_error (task, local_error);
+ g_task_return_error (task, g_steal_pointer (&local_error));
return;
}