internal/wayland: do not double close fd
All checks were successful
Test / Create distribution (push) Successful in 35s
Test / Sandbox (push) Successful in 2m15s
Test / Hakurei (push) Successful in 3m16s
Test / Hpkg (push) Successful in 4m7s
Test / Sandbox (race detector) (push) Successful in 4m14s
Test / Hakurei (race detector) (push) Successful in 5m5s
Test / Flake checks (push) Successful in 1m29s
All checks were successful
Test / Create distribution (push) Successful in 35s
Test / Sandbox (push) Successful in 2m15s
Test / Hakurei (push) Successful in 3m16s
Test / Hpkg (push) Successful in 4m7s
Test / Sandbox (race detector) (push) Successful in 4m14s
Test / Hakurei (race detector) (push) Successful in 5m5s
Test / Flake checks (push) Successful in 1m29s
These are already closed during securityContextBindPipe on a non-nil error. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
3afca2bd5b
commit
a495e09a8f
@ -51,10 +51,8 @@ func New(displayPath, bindPath *check.Absolute, appID, instanceID string) (*Secu
|
|||||||
} else {
|
} else {
|
||||||
closeFds, bindErr := securityContextBindPipe(fd, bindPath, appID, instanceID)
|
closeFds, bindErr := securityContextBindPipe(fd, bindPath, appID, instanceID)
|
||||||
if bindErr != nil {
|
if bindErr != nil {
|
||||||
// do not leak the pipe and socket
|
|
||||||
err = errors.Join(bindErr, // already wrapped
|
err = errors.Join(bindErr, // already wrapped
|
||||||
syscall.Close(closeFds[1]),
|
// do not leak the socket
|
||||||
syscall.Close(closeFds[0]),
|
|
||||||
syscall.Close(fd),
|
syscall.Close(fd),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user