internal/wayland: do not double close fd

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

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

View File

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