mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Fix memory leak in LUKS2 requirements handling for restore context.
This commit is contained in:
@@ -1019,14 +1019,15 @@ int LUKS2_hdr_restore(struct crypt_device *cd, struct luks2_hdr *hdr,
|
||||
|
||||
if (r < 0) {
|
||||
log_err(cd, _("Backup file doesn't contain valid LUKS header.\n"));
|
||||
return r;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* do not allow header restore from backup with unmet requirements */
|
||||
if (LUKS2_unmet_requirements(cd, &hdr_file, 0, 1)) {
|
||||
log_err(cd, _("Unmet LUKS2 requirements detected in backup %s.\n"),
|
||||
backup_file);
|
||||
return -ETXTBSY;
|
||||
r = -ETXTBSY;
|
||||
goto out;
|
||||
}
|
||||
|
||||
buffer_size = LUKS2_hdr_and_areas_size(hdr_file.jobj);
|
||||
|
||||
Reference in New Issue
Block a user