aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/wayland
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-11-17 22:00:57 +0900
committerOphestra <cat@gensokyo.uk>2025-11-17 22:03:29 +0900
commita495e09a8f11041fb23a9587c0dc9f52513a2937 (patch)
treebf0e8e702a691b868dc75ba6389e0ddd8511738c /internal/wayland
parent3afca2bd5b58645ad503bc8ef6dfa4f05d2e01e0 (diff)
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>
Diffstat (limited to 'internal/wayland')
-rw-r--r--internal/wayland/conn.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/internal/wayland/conn.go b/internal/wayland/conn.go
index 4a4428b5..fa7ced8c 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),
)
}