Commit 06894e02 authored by Christian Kellner's avatar Christian Kellner

thunderbolt: fix double free in bolt client

In the async version of the client creation, i.e. when a new client
is created via bolt_client_new_async and an error happens it will be
passed to g_task_return_error which takes ownership of it but the very
same error will also be free'd via g_autoptr; remove the latter.

This is a port of bolt commit e96f8bd47587b167ae46c8ac9347003f69f931dd
parent 4496680e
......@@ -219,7 +219,7 @@ got_the_client (GObject *source,
GAsyncResult *res,
gpointer user_data)
{
g_autoptr(GError) error = NULL;
GError *error = NULL;
GTask *task = user_data;
GObject *obj;
......@@ -227,6 +227,7 @@ got_the_client (GObject *source,
if (obj == NULL)
{
/* error ownership gets transferred to the task */
g_task_return_error (task, error);
return;
}
......@@ -240,7 +241,7 @@ got_the_bus (GObject *source,
GAsyncResult *res,
gpointer user_data)
{
g_autoptr(GError) error = NULL;
GError *error = NULL;
GTask *task = user_data;
GCancellable *cancellable;
GDBusConnection *bus;
......@@ -249,6 +250,7 @@ got_the_bus (GObject *source,
if (bus == NULL)
{
g_prefix_error (&error, "could not connect to D-Bus: ");
/* error ownership gets transferred to the task */
g_task_return_error (task, error);
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment