|
|
8ae392 |
From 7c9933c0f80faaabbed607983fdf77f8c4562df6 Mon Sep 17 00:00:00 2001
|
|
|
8ae392 |
From: Tomas Bzatek <tbzatek@redhat.com>
|
|
|
8ae392 |
Date: Sat, 1 Jan 2022 20:11:57 +0100
|
|
|
8ae392 |
Subject: [PATCH] udiskslinuxpartition: Fix GError ownership
|
|
|
8ae392 |
|
|
|
8ae392 |
---
|
|
|
8ae392 |
src/udiskslinuxpartition.c | 15 ++++++---------
|
|
|
8ae392 |
1 file changed, 6 insertions(+), 9 deletions(-)
|
|
|
8ae392 |
|
|
|
8ae392 |
diff --git a/src/udiskslinuxpartition.c b/src/udiskslinuxpartition.c
|
|
|
8ae392 |
index 5461b3903..3d970768d 100644
|
|
|
8ae392 |
--- a/src/udiskslinuxpartition.c
|
|
|
8ae392 |
+++ b/src/udiskslinuxpartition.c
|
|
|
8ae392 |
@@ -135,8 +135,7 @@ check_authorization (UDisksPartition *partition,
|
|
|
8ae392 |
caller_uid,
|
|
|
8ae392 |
&error))
|
|
|
8ae392 |
{
|
|
|
8ae392 |
- g_dbus_method_invocation_return_gerror (invocation, error);
|
|
|
8ae392 |
- g_clear_error (&error);
|
|
|
8ae392 |
+ g_dbus_method_invocation_take_error (invocation, error);
|
|
|
8ae392 |
goto out;
|
|
|
8ae392 |
}
|
|
|
8ae392 |
|
|
|
8ae392 |
@@ -351,7 +350,7 @@ handle_set_flags (UDisksPartition *partition,
|
|
|
8ae392 |
object = udisks_daemon_util_dup_object (partition, &error);
|
|
|
8ae392 |
if (object == NULL)
|
|
|
8ae392 |
{
|
|
|
8ae392 |
- g_dbus_method_invocation_take_error (invocation, error);
|
|
|
8ae392 |
+ g_dbus_method_invocation_return_gerror (invocation, error);
|
|
|
8ae392 |
goto out;
|
|
|
8ae392 |
}
|
|
|
8ae392 |
|
|
|
8ae392 |
@@ -499,7 +498,7 @@ handle_set_name (UDisksPartition *partition,
|
|
|
8ae392 |
object = udisks_daemon_util_dup_object (partition, &error);
|
|
|
8ae392 |
if (object == NULL)
|
|
|
8ae392 |
{
|
|
|
8ae392 |
- g_dbus_method_invocation_take_error (invocation, error);
|
|
|
8ae392 |
+ g_dbus_method_invocation_return_gerror (invocation, error);
|
|
|
8ae392 |
goto out;
|
|
|
8ae392 |
}
|
|
|
8ae392 |
|
|
|
8ae392 |
@@ -873,7 +872,7 @@ handle_resize (UDisksPartition *partition,
|
|
|
8ae392 |
object = udisks_daemon_util_dup_object (partition, &error);
|
|
|
8ae392 |
if (object == NULL)
|
|
|
8ae392 |
{
|
|
|
8ae392 |
- g_dbus_method_invocation_take_error (invocation, error);
|
|
|
8ae392 |
+ g_dbus_method_invocation_return_gerror (invocation, error);
|
|
|
8ae392 |
goto out;
|
|
|
8ae392 |
}
|
|
|
8ae392 |
|
|
|
8ae392 |
@@ -994,7 +993,7 @@ handle_delete (UDisksPartition *partition,
|
|
|
8ae392 |
object = udisks_daemon_util_dup_object (partition, &error);
|
|
|
8ae392 |
if (object == NULL)
|
|
|
8ae392 |
{
|
|
|
8ae392 |
- g_dbus_method_invocation_take_error (invocation, error);
|
|
|
8ae392 |
+ g_dbus_method_invocation_return_gerror (invocation, error);
|
|
|
8ae392 |
goto out;
|
|
|
8ae392 |
}
|
|
|
8ae392 |
|
|
|
8ae392 |
@@ -1012,9 +1011,7 @@ handle_delete (UDisksPartition *partition,
|
|
|
8ae392 |
if (!udisks_linux_block_teardown (block, invocation, options, &error))
|
|
|
8ae392 |
{
|
|
|
8ae392 |
if (invocation != NULL)
|
|
|
8ae392 |
- g_dbus_method_invocation_take_error (invocation, error);
|
|
|
8ae392 |
- else
|
|
|
8ae392 |
- g_clear_error (&error);
|
|
|
8ae392 |
+ g_dbus_method_invocation_return_gerror (invocation, error);
|
|
|
8ae392 |
goto out;
|
|
|
8ae392 |
}
|
|
|
8ae392 |
}
|