Skip to content

Commit

Permalink
Merge pull request #367 from jeremy-gill/journald_unix_socket_leak_fix
Browse files Browse the repository at this point in the history
journal: close unix socket after successful probe
  • Loading branch information
Luca Bruno committed Apr 15, 2021
2 parents 256724e + 68a12a3 commit 2aca22e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion journal/journal_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ func Enabled() bool {
return false
}

if _, err := net.Dial("unixgram", journalSocket); err != nil {
conn, err := net.Dial("unixgram", journalSocket)
if err != nil {
return false
}
defer conn.Close()

return true
}
Expand Down

0 comments on commit 2aca22e

Please sign in to comment.