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



commit f76e333d09bc43a30037490a63d16fb79ccb3149
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Wed Sep 6 20:46:14 2017 -0500

    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 files changed, 1 insertions(+), 1 deletions(-)
---
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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]