summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2014-09-21 22:24:09 +0200
committerStef Walter <stefw@gnome.org>2014-10-14 17:55:45 +0200
commitf2e759970c1a3a42378528a15166221715493288 (patch)
treecd87863270bd0b7177506f8536dfbb45e9fcba88
parenta88f4fcf255495ee575b4b7b94574c3ca0b66ca1 (diff)
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
-rw-r--r--pkcs11/gkm/gkm-attributes.c1
-rw-r--r--pkcs11/xdg-store/test-xdg-trust.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/pkcs11/gkm/gkm-attributes.c b/pkcs11/gkm/gkm-attributes.c
index 0ec6846f..996028b5 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 347c00ef..9e4c1b70 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);