summaryrefslogtreecommitdiff
path: root/common/tests
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2013-03-20 22:20:25 +0100
committerStef Walter <stefw@gnome.org>2013-03-20 22:22:30 +0100
commit4b09d2b4d3958b58b020c1ae21fcd932e1eb6c37 (patch)
treeabba9eb25d2d7d4c9804ba56741e08e40b0fe417 /common/tests
parent57d8f36a6cfbde5a9a783f11f2b75f19005c23e1 (diff)
Fix memory leaks reported by 'make leakcheck'
Diffstat (limited to 'common/tests')
-rw-r--r--common/tests/test-hash.c2
-rw-r--r--common/tests/test-utf8.c4
-rw-r--r--common/tests/test-x509.c1
3 files changed, 7 insertions, 0 deletions
diff --git a/common/tests/test-hash.c b/common/tests/test-hash.c
index d6d7990..c8694e1 100644
--- a/common/tests/test-hash.c
+++ b/common/tests/test-hash.c
@@ -89,6 +89,8 @@ test_sha1_long (CuTest *cu)
p11_hash_sha1 (checksum, input, 1000000, NULL);
CuAssertTrue (cu, memcmp (expected, checksum, P11_HASH_SHA1_LEN) == 0);
+
+ free (input);
}
const char *md5_input[] = {
diff --git a/common/tests/test-utf8.c b/common/tests/test-utf8.c
index d34f597..ed13fa2 100644
--- a/common/tests/test-utf8.c
+++ b/common/tests/test-utf8.c
@@ -38,6 +38,7 @@
#include "utf8.h"
#include <stdio.h>
+#include <stdlib.h>
#define ELEMS(x) (sizeof (x) / sizeof (x[0]))
@@ -74,6 +75,7 @@ test_ucs2be (CuTest *cu)
CuAssertIntEquals (cu, fixtures[i].output_len, length);
CuAssertStrEquals (cu, fixtures[i].output, output);
+ free (output);
}
}
@@ -146,6 +148,8 @@ test_ucs4be (CuTest *cu)
CuAssertIntEquals (cu, fixtures[i].output_len, length);
CuAssertStrEquals (cu, fixtures[i].output, output);
+
+ free (output);
}
}
diff --git a/common/tests/test-x509.c b/common/tests/test-x509.c
index 08c269d..2596c9c 100644
--- a/common/tests/test-x509.c
+++ b/common/tests/test-x509.c
@@ -397,6 +397,7 @@ test_directory_string (CuTest *tc)
CuAssertIntEquals (tc, fixtures[i].output_len, length);
CuAssertStrEquals (tc, fixtures[i].output, string);
+ free (string);
}
}