Skip to content

Commit ff118ad

Browse files
committed
Close the tempfile when journaling large messages
When we fail to log a message to journald due to ENOBUFS or EMSGSIZE, we attempt to pass the message to journald by passing it a descriptor attached to some shared memory. We need to close the descriptor, too.
1 parent 2ed5b50 commit ff118ad

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

journal/journal.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ func Send(message string, priority Priority, vars map[string]string) error {
9090
if err != nil {
9191
return journalError(err.Error())
9292
}
93+
defer file.Close()
9394
_, err = io.Copy(file, data)
9495
if err != nil {
9596
return journalError(err.Error())

0 commit comments

Comments
 (0)