From a495e09a8f11041fb23a9587c0dc9f52513a2937 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 17 Nov 2025 22:00:57 +0900 Subject: [PATCH] internal/wayland: do not double close fd These are already closed during securityContextBindPipe on a non-nil error. Signed-off-by: Ophestra --- internal/wayland/conn.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/wayland/conn.go b/internal/wayland/conn.go index 4a4428b..fa7ced8 100644 --- a/internal/wayland/conn.go +++ b/internal/wayland/conn.go @@ -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), ) }