diff options
author | Michael Catanzaro <mcatanzaro@redhat.com> | 2023-05-16 08:14:39 -0500 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@redhat.com> | 2023-05-16 08:14:39 -0500 |
commit | 25e1e11c811efa1c1809992f5fe7e3af9e44f7c3 (patch) | |
tree | e6d6a0c046b650a2b646477de584721c4c1719f2 | |
parent | b814e464f656f20925311316e776fb41ae3b3d92 (diff) | |
download | libsecret-25e1e11c811efa1c1809992f5fe7e3af9e44f7c3.tar.gz |
file-backend: avoid critical when cancellable is unset
In 0e205fce5fbfa8f2c6f6ac0acc890311ff333d04 I improperly assumed that
the cancellable would always be valid. Avoid criticals when it is NULL.
-rw-r--r-- | libsecret/secret-file-backend.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libsecret/secret-file-backend.c b/libsecret/secret-file-backend.c index dd18a5b..825851b 100644 --- a/libsecret/secret-file-backend.c +++ b/libsecret/secret-file-backend.c @@ -581,7 +581,8 @@ secret_file_backend_real_init_async (GAsyncInitable *initable, init = g_new0 (InitClosure, 1); init->io_priority = io_priority; init->file = file; - init->cancellable = g_object_ref (cancellable); + if (cancellable) + init->cancellable = g_object_ref (cancellable); g_task_set_task_data (task, init, init_closure_free); g_bus_get (G_BUS_TYPE_SESSION, cancellable, on_bus_get, task); } else { |