[gnome-keyring] secret-store/test*: Don't leak secret data memory
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-keyring] secret-store/test*: Don't leak secret data memory
- Date: Tue, 14 Oct 2014 16:20:16 +0000 (UTC)
commit bf96feaff541668ead5438ee074c4318165a3962
Author: Christophe Fergeau <cfergeau redhat com>
Date: Wed Oct 1 22:55:36 2014 +0200
secret-store/test*: Don't leak secret data memory
Both test-secret-binary and test-secret-textual call
g_file_get_contents() but never free the returned data, causing a memory
leak.
https://bugzilla.gnome.org/show_bug.cgi?id=738508
pkcs11/secret-store/test-secret-binary.c | 1 +
pkcs11/secret-store/test-secret-textual.c | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/pkcs11/secret-store/test-secret-binary.c b/pkcs11/secret-store/test-secret-binary.c
index e06c256..b19babf 100644
--- a/pkcs11/secret-store/test-secret-binary.c
+++ b/pkcs11/secret-store/test-secret-binary.c
@@ -156,6 +156,7 @@ test_write (Test *test, gconstpointer unused)
/* Try parsing it again */
res = gkm_secret_binary_read (test->collection, test->sdata, data, n_data);
g_assert (res == GKM_DATA_SUCCESS);
+ g_free (data);
}
static void
diff --git a/pkcs11/secret-store/test-secret-textual.c b/pkcs11/secret-store/test-secret-textual.c
index 497804f..39a7f35 100644
--- a/pkcs11/secret-store/test-secret-textual.c
+++ b/pkcs11/secret-store/test-secret-textual.c
@@ -148,6 +148,7 @@ test_write (Test *test, gconstpointer unused)
/* Try parsing it again */
res = gkm_secret_textual_read (test->collection, test->sdata, data, n_data);
g_assert (res == GKM_DATA_SUCCESS);
+ g_free (data);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]