mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-06 00:10:04 +01:00
Fix wrong return value from LUKS2_generate_hdr on error.
On rare occasion (low memory) the function could return success even though LUKS2 json metadata could be assembled properly.
This commit is contained in:
@@ -360,6 +360,7 @@ int LUKS2_generate_hdr(
|
|||||||
|
|
||||||
if (json_object_object_add_by_uint(jobj_segments, 0, jobj_segment)) {
|
if (json_object_object_add_by_uint(jobj_segments, 0, jobj_segment)) {
|
||||||
json_object_put(jobj_segment);
|
json_object_put(jobj_segment);
|
||||||
|
r = -ENOMEM;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user