mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-13 11:50:10 +01:00
Reduce memory allocations in vk keyring keyslot context.
This commit is contained in:
@@ -520,9 +520,9 @@ static int get_key_by_vk_in_keyring(struct crypt_device *cd,
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
*r_vk = crypt_alloc_volume_key(key_size, key);
|
*r_vk = crypt_alloc_volume_key_by_safe_alloc((void **)&key);
|
||||||
crypt_safe_free(key);
|
|
||||||
if (!*r_vk) {
|
if (!*r_vk) {
|
||||||
|
crypt_safe_free(key);
|
||||||
kc->error = -ENOMEM;
|
kc->error = -ENOMEM;
|
||||||
return kc->error;
|
return kc->error;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user