mirror of
https://github.com/prometheus-community/windows_exporter
synced 2024-12-23 15:02:16 +00:00
initiate: close event log handle (#1654)
This commit is contained in:
parent
b67b930ffc
commit
e6aaf91df1
@ -83,6 +83,9 @@ func logToEventToLog(eType uint16, msg string) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to open event log: %w", err)
|
||||
}
|
||||
defer func(eventLog *eventlog.Log) {
|
||||
_ = eventLog.Close()
|
||||
}(eventLog)
|
||||
|
||||
p, err := windows.UTF16PtrFromString(msg)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user