fix: close dup fd

This commit is contained in:
SunBK201 2025-12-09 16:24:55 +08:00
parent 8132085c8c
commit 1558b8a28b

View File

@ -55,6 +55,7 @@ func GetConnFD(conn net.Conn) (fd int, err error) {
if err != nil {
return 0, fmt.Errorf("tcpConn.File: %v", err)
}
defer file.Close()
return int(file.Fd()), nil
}