Fix leak of json struct on crypt_format() error path.

This commit is contained in:
Milan Broz
2019-01-02 14:08:41 +01:00
parent ee7ff024c1
commit e23fa65ef2

View File

@@ -1686,7 +1686,7 @@ static int _crypt_format_luks2(struct crypt_device *cd,
r = device_check_size(cd, crypt_data_device(cd), crypt_get_data_offset(cd) * SECTOR_SIZE, 0);
if (r < 0)
return r;
goto out;
if (!integrity && sector_size > SECTOR_SIZE && !device_size(crypt_data_device(cd), &dev_size)) {
dev_size -= (crypt_get_data_offset(cd) * SECTOR_SIZE);