[epiphany/mcatanzaro/#1773: 51/53] password-manager: Fix crash when deleting all passwords
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/mcatanzaro/#1773: 51/53] password-manager: Fix crash when deleting all passwords
- Date: Thu, 26 May 2022 16:05:22 +0000 (UTC)
commit 1e2a52481b7755fd6fe373efc8cd325f6c4e8960
Author: Michael Catanzaro <mcatanzaro redhat com>
Date: Fri May 6 16:43:12 2022 -0500
password-manager: Fix crash when deleting all passwords
This broke in 7d080a31. The callback here is not prepared for there to
be no async data, but the async data is only required when clearing a
single password, not when clearing all of them. The GTask is optional
even if there is async data. We're just going to need a bunch of
conditionals here.
Fixes #1773
Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1109>
lib/sync/ephy-password-manager.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/lib/sync/ephy-password-manager.c b/lib/sync/ephy-password-manager.c
index f8a15df77..25af8863a 100644
--- a/lib/sync/ephy-password-manager.c
+++ b/lib/sync/ephy-password-manager.c
@@ -735,22 +735,22 @@ secret_password_clear_cb (GObject *source_object,
secret_password_clear_finish (result, &error);
if (error) {
- if (data->task)
+ if (data && data->task)
g_task_return_error (data->task, error);
- else
+ else if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Failed to clear secrets from password schema: %s", error->message);
-
- manage_record_async_data_free (data);
+ g_clear_pointer (&data, manage_record_async_data_free);
return;
}
- if (data->record)
- ephy_password_manager_store_record (data->manager, data->record);
-
- if (data->task)
- g_task_return_boolean (data->task, TRUE);
+ if (data) {
+ if (data->record)
+ ephy_password_manager_store_record (data->manager, data->record);
+ if (data->task)
+ g_task_return_boolean (data->task, TRUE);
+ }
- manage_record_async_data_free (data);
+ g_clear_pointer (&data, manage_record_async_data_free);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]