| From f76e333d09bc43a30037490a63d16fb79ccb3149 Mon Sep 17 00:00:00 2001 |
| From: Michael Catanzaro <mcatanzaro@igalia.com> |
| Date: Wed, 6 Sep 2017 20:46:14 -0500 |
| Subject: [PATCH] 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 |
| --- |
| libsecret/secret-methods.c | 2 +- |
| 1 file changed, 1 insertion(+), 1 deletion(-) |
| |
| diff --git a/libsecret/secret-methods.c b/libsecret/secret-methods.c |
| index 48eb716..c0cbc99 100644 |
| --- a/libsecret/secret-methods.c |
| +++ b/libsecret/secret-methods.c |
| @@ -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); |
| -- |
| 2.11.0 |
| |