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