Skip to content

Commit 2aca22e

Browse files
author
Luca Bruno
authored
Merge pull request #367 from jeremy-gill/journald_unix_socket_leak_fix
journal: close unix socket after successful probe
2 parents 256724e + 68a12a3 commit 2aca22e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

journal/journal_unix.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ func Enabled() bool {
6565
return false
6666
}
6767

68-
if _, err := net.Dial("unixgram", journalSocket); err != nil {
68+
conn, err := net.Dial("unixgram", journalSocket)
69+
if err != nil {
6970
return false
7071
}
72+
defer conn.Close()
7173

7274
return true
7375
}

0 commit comments

Comments
 (0)