[gnome-keyring] test-xdg-trust: Fix GChecksum leaks



commit f2e759970c1a3a42378528a15166221715493288
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Sun Sep 21 22:24:09 2014 +0200

    test-xdg-trust: Fix GChecksum leaks
    
    'md' is created using g_checksum_new() so it must be destroyed
    with g_checksum_free() after use.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=738508

 pkcs11/gkm/gkm-attributes.c       |    1 +
 pkcs11/xdg-store/test-xdg-trust.c |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/pkcs11/gkm/gkm-attributes.c b/pkcs11/gkm/gkm-attributes.c
index 0ec6846..996028b 100644
--- a/pkcs11/gkm/gkm-attributes.c
+++ b/pkcs11/gkm/gkm-attributes.c
@@ -359,6 +359,7 @@ gkm_attribute_set_checksum (CK_ATTRIBUTE_PTR attr, GChecksumType ctype,
        g_checksum_update (checksum, data, n_data);
        result = attr->ulValueLen;
        g_checksum_get_digest (checksum, attr->pValue, &result);
+       g_checksum_free (checksum);
        attr->ulValueLen = result;
        return CKR_OK;
 }
diff --git a/pkcs11/xdg-store/test-xdg-trust.c b/pkcs11/xdg-store/test-xdg-trust.c
index 347c00e..9e4c1b7 100644
--- a/pkcs11/xdg-store/test-xdg-trust.c
+++ b/pkcs11/xdg-store/test-xdg-trust.c
@@ -656,6 +656,7 @@ _assert_positive_netscape (Test *test, CK_X_ASSERTION_TYPE assertion_type, const
        n_checksum = sizeof (checksum);
        g_checksum_get_digest (md, checksum, &n_checksum);
        g_assert (n_checksum == sizeof (checksum));
+       g_checksum_free (md);
 
        rv = gkm_session_C_FindObjectsInit (test->session, lookup, G_N_ELEMENTS (lookup));
        gkm_assert_cmprv (rv, ==, CKR_OK);


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