[gnome-keyring/trust-store: 7/7] [gcr] Fix memory leaks in trust lookup tests.



commit 54488eab6da95b325f2b15965bc355b6848aa535
Author: Stef Walter <stefw collabora co uk>
Date:   Mon Dec 13 19:38:34 2010 +0000

    [gcr] Fix memory leaks in trust lookup tests.

 gcr/tests/test-trust.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gcr/tests/test-trust.c b/gcr/tests/test-trust.c
index 38dd226..0bb0215 100644
--- a/gcr/tests/test-trust.c
+++ b/gcr/tests/test-trust.c
@@ -51,6 +51,7 @@ TESTING_SETUP (trust_setup)
 	g_assert (contents);
 
 	certificate = gcr_simple_certificate_new (contents, len);
+	g_free (contents);
 
 	rv = gck_mock_C_GetFunctionList (&f);
 	gck_assert_cmprv (rv, ==, CKR_OK);
@@ -120,6 +121,7 @@ TESTING_TEST (trust_add_certificate_pinned_fail)
 	ret = gcr_trust_add_pinned_certificate (certificate, GCR_PURPOSE_CLIENT_AUTH, "peer", NULL, &error);
 	g_assert (ret == FALSE);
 	g_assert_error (error, GCK_ERROR, CKR_FUNCTION_FAILED);
+	g_clear_error (&error);
 }
 
 TESTING_TEST (trust_add_and_remov_pinned)



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