Blame SOURCES/0001-thunderbolt-fix-double-free-in-bolt-client.patch

365ad8
From 06894e020a75b9ea670ed524a02b6bf939dc4e9c Mon Sep 17 00:00:00 2001
365ad8
From: Christian Kellner <christian@kellner.me>
365ad8
Date: Tue, 8 Jan 2019 17:22:41 +0100
365ad8
Subject: [PATCH] thunderbolt: fix double free in bolt client
365ad8
365ad8
In the async version of the client creation, i.e. when a new client
365ad8
is created via bolt_client_new_async and an error happens it will be
365ad8
passed to g_task_return_error which takes ownership of it but the very
365ad8
same error will also be free'd via g_autoptr; remove the latter.
365ad8
365ad8
This is a port of bolt commit e96f8bd47587b167ae46c8ac9347003f69f931dd
365ad8
---
365ad8
 panels/thunderbolt/bolt-client.c | 6 ++++--
365ad8
 1 file changed, 4 insertions(+), 2 deletions(-)
365ad8
365ad8
diff --git a/panels/thunderbolt/bolt-client.c b/panels/thunderbolt/bolt-client.c
365ad8
index 0ebc360b1..00038bd7b 100644
365ad8
--- a/panels/thunderbolt/bolt-client.c
365ad8
+++ b/panels/thunderbolt/bolt-client.c
365ad8
@@ -219,7 +219,7 @@ got_the_client (GObject      *source,
365ad8
                 GAsyncResult *res,
365ad8
                 gpointer      user_data)
365ad8
 {
365ad8
-  g_autoptr(GError) error = NULL;
365ad8
+  GError *error = NULL;
365ad8
   GTask *task = user_data;
365ad8
   GObject *obj;
365ad8
 
365ad8
@@ -227,6 +227,7 @@ got_the_client (GObject      *source,
365ad8
 
365ad8
   if (obj == NULL)
365ad8
     {
365ad8
+      /* error ownership gets transferred to the task */
365ad8
       g_task_return_error (task, error);
365ad8
       return;
365ad8
     }
365ad8
@@ -240,7 +241,7 @@ got_the_bus (GObject      *source,
365ad8
              GAsyncResult *res,
365ad8
              gpointer      user_data)
365ad8
 {
365ad8
-  g_autoptr(GError) error = NULL;
365ad8
+  GError *error = NULL;
365ad8
   GTask *task = user_data;
365ad8
   GCancellable *cancellable;
365ad8
   GDBusConnection *bus;
365ad8
@@ -249,6 +250,7 @@ got_the_bus (GObject      *source,
365ad8
   if (bus == NULL)
365ad8
     {
365ad8
       g_prefix_error (&error, "could not connect to D-Bus: ");
365ad8
+      /* error ownership gets transferred to the task */
365ad8
       g_task_return_error (task, error);
365ad8
       return;
365ad8
     }
365ad8
-- 
365ad8
2.23.0.rc1
365ad8