secret-methods: Don't unref NULL when search fails

If the gnome-keyring D-Bus service is not responding, we wind up freeing
the SearchClosure in an error path without ever creating a SecretService
object. Guard against this.

https://bugzilla.gnome.org/show_bug.cgi?id=787391
This commit is contained in:
Michael Catanzaro 2017-09-06 20:46:14 -05:00
parent e7961fee3a
commit f76e333d09

View File

@ -51,7 +51,7 @@ static void
search_closure_free (gpointer data)
{
SearchClosure *closure = data;
g_object_unref (closure->service);
g_clear_object (&closure->service);
g_clear_object (&closure->cancellable);
g_hash_table_unref (closure->items);
g_variant_unref (closure->attributes);