mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-13 11:50:10 +01:00
Fix memleak in test.
By defining custom buffer free function in test token handler the default call to free() gets skipped.
This commit is contained in:
committed by
Milan Broz
parent
79444bc615
commit
abf7e3e359
@@ -655,11 +655,6 @@ static int test_open_pass1(struct crypt_device *_cd __attribute__((unused)),
|
|||||||
return 0;
|
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)
|
static int test_validate(struct crypt_device *_cd __attribute__((unused)), const char *json)
|
||||||
{
|
{
|
||||||
return (strstr(json, "magic_string") == NULL);
|
return (strstr(json, "magic_string") == NULL);
|
||||||
@@ -2077,11 +2072,9 @@ static void Tokens(void)
|
|||||||
}, th4 = {
|
}, th4 = {
|
||||||
.name = "test_token2",
|
.name = "test_token2",
|
||||||
.open = test_open_pass, // PASSPHRASE
|
.open = test_open_pass, // PASSPHRASE
|
||||||
.buffer_free = test_token_free
|
|
||||||
}, th5 = {
|
}, th5 = {
|
||||||
.name = "test_token3",
|
.name = "test_token3",
|
||||||
.open = test_open_pass1, // PASSPHRASE1
|
.open = test_open_pass1, // PASSPHRASE1
|
||||||
.buffer_free = test_token_free
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct crypt_token_params_luks2_keyring params = {
|
struct crypt_token_params_luks2_keyring params = {
|
||||||
|
|||||||
Reference in New Issue
Block a user