aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Kozina <okozina@redhat.com>2023-11-03 15:11:26 +0100
committerMilan Broz <gmazyland@gmail.com>2023-11-03 21:27:59 +0000
commitabf7e3e359321809a7ce3b465e425e9e417998cc (patch)
tree353d2c69289b49d1afbec4b891552ac2d1755a73
parent79444bc61594624982806aa85f5d9ce6e9b5bef4 (diff)
downloadcryptsetup-abf7e3e359321809a7ce3b465e425e9e417998cc.tar.gz
Fix memleak in test.
By defining custom buffer free function in test token handler the default call to free() gets skipped.
-rw-r--r--tests/api-test-2.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/tests/api-test-2.c b/tests/api-test-2.c
index a7ceda05..5d07c2fc 100644
--- a/tests/api-test-2.c
+++ b/tests/api-test-2.c
@@ -655,11 +655,6 @@ static int test_open_pass1(struct crypt_device *_cd __attribute__((unused)),
return 0;
}
-static void test_token_free(void *ubffer __attribute__((unused)),
- size_t buffer_len __attribute__((unused)))
-{
-}
-
static int test_validate(struct crypt_device *_cd __attribute__((unused)), const char *json)
{
return (strstr(json, "magic_string") == NULL);
@@ -2077,11 +2072,9 @@ static void Tokens(void)
}, th4 = {
.name = "test_token2",
.open = test_open_pass, // PASSPHRASE
- .buffer_free = test_token_free
}, th5 = {
.name = "test_token3",
.open = test_open_pass1, // PASSPHRASE1
- .buffer_free = test_token_free
};
struct crypt_token_params_luks2_keyring params = {