fix memory leaks in tests

This commit is contained in:
Lukas Lihotzki 2020-10-01 15:39:48 +02:00
parent 73a9ced64e
commit be0c31894a
2 changed files with 13 additions and 0 deletions

View file

@ -69,6 +69,9 @@ assert_not_equals(std::size_t(-1), ::olm_account_identity_keys(
account, id_keys, id_keys_size account, id_keys, id_keys_size
)); ));
olm_clear_account(account);
free(account_buffer);
void * utility_buffer = check_malloc(::olm_utility_size()); void * utility_buffer = check_malloc(::olm_utility_size());
::OlmUtility * utility = ::olm_utility(utility_buffer); ::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 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);
} }
} }

View file

@ -224,6 +224,9 @@ result = ::olm_ed25519_verify(
assert_equals((size_t)-1, result); assert_equals((size_t)-1, result);
olm_clear_utility(utility);
free(utility_buffer);
free(message); free(message);
free(sig_buffer); free(sig_buffer);