internal/wayland: do not double close fd
All checks were successful
Test / Create distribution (push) Successful in 35s
Test / Sandbox (push) Successful in 2m18s
Test / Hakurei (push) Successful in 3m18s
Test / Hpkg (push) Successful in 4m9s
Test / Sandbox (race detector) (push) Successful in 4m19s
Test / Hakurei (race detector) (push) Successful in 5m8s
Test / Flake checks (push) Successful in 1m28s

These are already closed during securityContextBindPipe on a non-nil error.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
Ophestra 2025-11-17 22:00:57 +09:00
parent 3afca2bd5b
commit b4e10616fe
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q

View File

@ -53,8 +53,6 @@ func New(displayPath, bindPath *check.Absolute, appID, instanceID string) (*Secu
if bindErr != nil { if bindErr != nil {
// do not leak the pipe and socket // do not leak the pipe and socket
err = errors.Join(bindErr, // already wrapped err = errors.Join(bindErr, // already wrapped
syscall.Close(closeFds[1]),
syscall.Close(closeFds[0]),
syscall.Close(fd), syscall.Close(fd),
) )
} }