]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
xzdec: Don't leave Landlock file descriptor open for no reason
authorLasse Collin <lasse.collin@tukaani.org>
Sat, 4 Jan 2025 18:04:56 +0000 (20:04 +0200)
committerLasse Collin <lasse.collin@tukaani.org>
Sat, 4 Jan 2025 18:05:03 +0000 (20:05 +0200)
This fix is similar to 48ff3f06521ca326996ab9a04d1b342098960427.

Fixes: d74fb5f060b76db709b50f5fd37490394e52f975
src/xzdec/xzdec.c

index 2a63ab58a25c786b691fa86f710168ce98aa72e1..8413421374af064f18be83065726d9fed68668fc 100644 (file)
@@ -343,6 +343,8 @@ sandbox_enter(int src_fd)
                // before activating the sandbox.
                if (my_landlock_restrict_self(ruleset_fd, 0) != 0)
                        goto error;
+
+               (void)close(ruleset_fd);
        }
 
        (void)src_fd;