Skip to content

Commit 8c1b3f9

Browse files
committed
fix(seccompagent): close received FDs, not loop index
Prevents accidentally closing 0/1/2 on error paths. Signed-off-by: Joshua Rogers <[email protected]>
1 parent 80486a2 commit 8c1b3f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/cmd/seccompagent/seccompagent.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ var (
3232
)
3333

3434
func closeStateFds(recvFds []int) {
35-
for i := range recvFds {
36-
unix.Close(i)
35+
for _, fd := range recvFds {
36+
_ = unix.Close(fd)
3737
}
3838
}
3939

0 commit comments

Comments
 (0)