Merge pull request #4796 from astrawind/fix/seccomp-agent-conn-leak

libcontainer: close seccomp agent connection to prevent resource leaks
This commit is contained in:
lfbzhm
2025-07-04 00:08:21 +08:00
committed by GitHub
+1
View File
@@ -896,6 +896,7 @@ func sendContainerProcessState(listenerPath string, state *specs.ContainerProces
if err != nil { if err != nil {
return fmt.Errorf("failed to connect with seccomp agent specified in the seccomp profile: %w", err) return fmt.Errorf("failed to connect with seccomp agent specified in the seccomp profile: %w", err)
} }
defer conn.Close()
socket, err := conn.(*net.UnixConn).File() socket, err := conn.(*net.UnixConn).File()
if err != nil { if err != nil {