libcontainer: close seccomp agent connection to prevent resource leaks

Add missing defer conn.Close().

Signed-off-by: Pavel Liubimov <prlyubimov@gmail.com>
(cherry picked from commit aa0e7989c4)
Signed-off-by: Pavel Liubimov <prlyubimov@gmail.com>
This commit is contained in:
Pavel Liubimov
2025-07-01 12:22:07 +03:00
parent 98eb876379
commit 3e32756ef7
+1
View File
@@ -871,6 +871,7 @@ func sendContainerProcessState(listenerPath string, state *specs.ContainerProces
if err != nil {
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()
if err != nil {