[gnome-keyring] xdg: Don't leak ref in lookup_or_create_assertion_key()



commit bbb96835cc4120d6c9f0d7bf272f6eb386a07468
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Sun Sep 21 19:00:57 2014 +0200

    xdg: Don't leak ref in lookup_or_create_assertion_key()
    
    When lookup_or_create_assertion_key() creates a new assertion key,
    it own a reference on the GBytes created by create_assertion_key()
    and it will then take an extra ref on it when associating it with a
    GkmAssertion instance.
    
    This will cause a leak of the memory returned by create_assertion_key()
    as one of these references will never be dropped.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=738508

 pkcs11/xdg-store/gkm-xdg-trust.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/pkcs11/xdg-store/gkm-xdg-trust.c b/pkcs11/xdg-store/gkm-xdg-trust.c
index 4389ae1..c42682f 100644
--- a/pkcs11/xdg-store/gkm-xdg-trust.c
+++ b/pkcs11/xdg-store/gkm-xdg-trust.c
@@ -371,7 +371,7 @@ lookup_or_create_assertion_key (GkmAssertion *assertion)
                key = create_assertion_key (gkm_assertion_get_purpose (assertion),
                                            gkm_assertion_get_peer (assertion));
                g_object_set_qdata_full (G_OBJECT (assertion), QDATA_ASSERTION_KEY,
-                                        g_bytes_ref (key), (GDestroyNotify)g_bytes_unref);
+                                        key, (GDestroyNotify)g_bytes_unref);
        }
 
        return key;


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