xz: Landlock: Fix a file descriptor leak

(cherry picked from commit 48ff3f0652)
This commit is contained in:
Mark Wielaard 2024-11-25 12:28:44 +02:00 committed by Lasse Collin
parent 77cab41f32
commit d9c2e7572b
No known key found for this signature in database
GPG Key ID: 38EE757D69184620
1 changed files with 1 additions and 0 deletions

View File

@ -196,6 +196,7 @@ enable_landlock(uint64_t required_rights)
if (syscall(SYS_landlock_restrict_self, ruleset_fd, 0U) != 0) if (syscall(SYS_landlock_restrict_self, ruleset_fd, 0U) != 0)
message_fatal(_("Failed to enable the sandbox")); message_fatal(_("Failed to enable the sandbox"));
(void)close(ruleset_fd);
return; return;
} }