summaryrefslogtreecommitdiff
path: root/trust/tests
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2013-07-23 16:45:50 +0200
committerStef Walter <stef@thewalter.net>2013-07-23 23:06:30 +0200
commitb14fc0351c4dd71c5ca71df77e325d2b2a4c0583 (patch)
treec4a47c77a977158b8bd4dcc8f478d6bc34ad233b /trust/tests
parentb7cc29a78c3c705374ff25223fe14749ddb076b9 (diff)
Fix various memory leaks exposed by 'make leakcheck'
Diffstat (limited to 'trust/tests')
-rw-r--r--trust/tests/Makefile.am12
-rw-r--r--trust/tests/test-asn1.c3
-rw-r--r--trust/tests/test-builder.c4
3 files changed, 12 insertions, 7 deletions
diff --git a/trust/tests/Makefile.am b/trust/tests/Makefile.am
index 5a6c9ec..53775df 100644
--- a/trust/tests/Makefile.am
+++ b/trust/tests/Makefile.am
@@ -37,6 +37,12 @@ LDADD = \
CHECK_PROGS = \
test-digest \
+ test-asn1 \
+ test-base64 \
+ test-pem \
+ test-oid \
+ test-utf8 \
+ test-x509 \
test-persist \
test-index \
test-parser \
@@ -48,12 +54,6 @@ CHECK_PROGS = \
test-cer \
test-bundle \
test-openssl \
- test-asn1 \
- test-base64 \
- test-pem \
- test-oid \
- test-utf8 \
- test-x509 \
$(NULL)
noinst_PROGRAMS = \
diff --git a/trust/tests/test-asn1.c b/trust/tests/test-asn1.c
index d5ec131..df75dfd 100644
--- a/trust/tests/test-asn1.c
+++ b/trust/tests/test-asn1.c
@@ -142,10 +142,11 @@ test_asn1_free (void)
asn = p11_asn1_decode (defs, "PKIX1.ExtKeyUsageSyntax",
test_eku_server_and_client,
sizeof (test_eku_server_and_client), NULL);
- assert_ptr_not_null (defs);
+ assert_ptr_not_null (asn);
p11_asn1_free (asn);
p11_asn1_free (NULL);
+ p11_dict_free (defs);
}
int
diff --git a/trust/tests/test-builder.c b/trust/tests/test-builder.c
index 1d37924..6e061aa 100644
--- a/trust/tests/test-builder.c
+++ b/trust/tests/test-builder.c
@@ -766,6 +766,7 @@ test_valid_dates (void)
rv = p11_builder_build (test.builder, test.index, attrs, input, &extra);
assert_num_eq (CKR_OK, rv);
+ p11_attrs_free (extra);
p11_attrs_free (attrs);
attrs = NULL;
@@ -773,6 +774,7 @@ test_valid_dates (void)
rv = p11_builder_build (test.builder, test.index, attrs, input, &extra);
assert_num_eq (CKR_OK, rv);
+ p11_attrs_free (extra);
p11_attrs_free (attrs);
}
@@ -831,6 +833,7 @@ test_valid_name (void)
rv = p11_builder_build (test.builder, test.index, attrs, input, &extra);
assert_num_eq (CKR_OK, rv);
+ p11_attrs_free (extra);
p11_attrs_free (attrs);
attrs = NULL;
@@ -839,6 +842,7 @@ test_valid_name (void)
rv = p11_builder_build (test.builder, test.index, attrs, input, &extra);
assert_num_eq (CKR_OK, rv);
+ p11_attrs_free (extra);
p11_attrs_free (attrs);
}