Fix an error path memory leak.

This commit is contained in:
Milan Broz
2021-02-04 17:54:36 +01:00
parent 3cd158b983
commit 56d55a4585

View File

@@ -2398,8 +2398,10 @@ static int action_luksErase(void)
/* Safety check */
max = crypt_keyslot_max(crypt_get_type(cd));
if (max <= 0)
return -EINVAL;
if (max <= 0) {
r = -EINVAL;
goto out;
}
for (i = 0; i < max; i++) {
ki = crypt_keyslot_status(cd, i);