[gnome-keyring] test-sexp: Fix 2 leaks
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-keyring] test-sexp: Fix 2 leaks
- Date: Tue, 14 Oct 2014 16:19:56 +0000 (UTC)
commit 17b429de6d2d911fcfac3fbc042aa5579a3a4535
Author: Christophe Fergeau <cfergeau redhat com>
Date: Wed Oct 1 22:40:13 2014 +0200
test-sexp: Fix 2 leaks
gcry_sexp_t objects created with gkm_sexp_parse_key() must be freed with
gcry_sexp_release(), and gcry_mpi_t objects created with
gkm_sexp_extract_mpi() must be freed with gcry_mpi_release() when no
longer used.
https://bugzilla.gnome.org/show_bug.cgi?id=738508
pkcs11/gkm/test-sexp.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/pkcs11/gkm/test-sexp.c b/pkcs11/gkm/test-sexp.c
index 1e1a746..87439ad 100644
--- a/pkcs11/gkm/test-sexp.c
+++ b/pkcs11/gkm/test-sexp.c
@@ -95,10 +95,12 @@ test_parse_key (Test *test, gconstpointer unused)
g_assert (algorithm == GCRY_PK_RSA);
g_assert (is_priv == TRUE);
g_assert (sexp != NULL);
+ gcry_sexp_release (sexp);
ret = gkm_sexp_extract_mpi (test->rsakey, &mpi, "p", NULL);
g_assert (ret);
g_assert (mpi != NULL);
+ gcry_mpi_release (mpi);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]