namespace: avoid assertion failure (#6649)

If the root image is not decrypted, it must not be relinquished.
This commit is contained in:
Topi Miettinen 2017-08-29 15:31:24 +00:00 committed by Lennart Poettering
parent 7123a951d0
commit 07ce74074d
1 changed files with 5 additions and 3 deletions

View File

@ -1063,9 +1063,11 @@ int setup_namespace(
if (r < 0)
goto finish;
r = decrypted_image_relinquish(decrypted_image);
if (r < 0)
goto finish;
if (decrypted_image) {
r = decrypted_image_relinquish(decrypted_image);
if (r < 0)
goto finish;
}
loop_device_relinquish(loop_device);