initiate: close event log handle (#1654)

This commit is contained in:
Jan-Otto Kröpke 2024-09-28 21:23:05 +02:00 committed by GitHub
parent b67b930ffc
commit e6aaf91df1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 {