aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLukas Lihotzki <lukas@lihotzki.de>2020-10-01 15:39:48 +0200
committerLukas Lihotzki <lukas@lihotzki.de>2020-10-01 15:39:48 +0200
commitbe0c31894aa6f0feaf6add47987513ea0167de8b (patch)
treee23ce1534f5552b6523ae4a6669bca0bdee49bc4 /tests
parent73a9ced64e0cbed6f6feec410e972550fe05f226 (diff)
fix memory leaks in tests
Diffstat (limited to 'tests')
-rw-r--r--tests/test_olm_signature.cpp10
-rw-r--r--tests/test_pk.cpp3
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_olm_signature.cpp b/tests/test_olm_signature.cpp
index d7259de..f53bcec 100644
--- a/tests/test_olm_signature.cpp
+++ b/tests/test_olm_signature.cpp
@@ -69,6 +69,9 @@ assert_not_equals(std::size_t(-1), ::olm_account_identity_keys(
account, id_keys, id_keys_size
));
+olm_clear_account(account);
+free(account_buffer);
+
void * utility_buffer = check_malloc(::olm_utility_size());
::OlmUtility * utility = ::olm_utility(utility_buffer);
@@ -76,6 +79,13 @@ assert_not_equals(std::size_t(-1), ::olm_ed25519_verify(
utility, id_keys + 71, 43, message, message_size, signature, signature_size
));
+olm_clear_utility(utility);
+free(utility_buffer);
+
+free(id_keys);
+free(signature);
+free(message);
+
}
}
diff --git a/tests/test_pk.cpp b/tests/test_pk.cpp
index 7679096..b917a2e 100644
--- a/tests/test_pk.cpp
+++ b/tests/test_pk.cpp
@@ -224,6 +224,9 @@ result = ::olm_ed25519_verify(
assert_equals((size_t)-1, result);
+olm_clear_utility(utility);
+free(utility_buffer);
+
free(message);
free(sig_buffer);