[gnome-keyring] [pkcs11] Fix freeing of unallocated memory in test.



commit e7326153a3241092c8df7f7aa4d8a59bddef8ee3
Author: Stefan Walter <stef ws local>
Date:   Sun Nov 15 16:06:40 2009 +0000

    [pkcs11] Fix freeing of unallocated memory in test.

 pkcs11/gck/tests/unit-test-data-der.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/pkcs11/gck/tests/unit-test-data-der.c b/pkcs11/gck/tests/unit-test-data-der.c
index fc4ba03..0259322 100644
--- a/pkcs11/gck/tests/unit-test-data-der.c
+++ b/pkcs11/gck/tests/unit-test-data-der.c
@@ -302,7 +302,8 @@ on_ca_certificate_public_key_info (GQuark type, const guchar *data, gsize n_data
 	res = gck_data_der_read_public_key_info (keydata, n_keydata, &sexp);
 	g_assert (res == GCK_DATA_SUCCESS || res == GCK_DATA_UNRECOGNIZED);
 
-	gcry_sexp_release (sexp);
+	if (res == GCK_DATA_SUCCESS)
+		gcry_sexp_release (sexp);
 	g_free (keydata);
 }
 



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