Skip to content

Commit

Permalink
fix(go-libtor-like): make sure we close the os.File
Browse files Browse the repository at this point in the history
It seems this diff is not necessary to see the real bug, but it
still seems correct to test with better code

Part of ooni/probe#2405
  • Loading branch information
bassosimone committed Feb 3, 2023
1 parent 727b8fd commit aedceaf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/libtor/enabled.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,6 @@ func (e *embeddedProcess) EmbeddedControlConn() (net.Conn, error) {
if err != nil {
return nil, fmt.Errorf("unable to create control socket: %v", err)
}
file.Close() // net.FileConn duplicates the fd
return conn, nil
}

0 comments on commit aedceaf

Please sign in to comment.