From e6aaf91df154ed37924e35c66edb9b3dca22110c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Sat, 28 Sep 2024 21:23:05 +0200 Subject: [PATCH] initiate: close event log handle (#1654) --- pkg/initiate/initiate.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/initiate/initiate.go b/pkg/initiate/initiate.go index cae053117..9d423c14d 100644 --- a/pkg/initiate/initiate.go +++ b/pkg/initiate/initiate.go @@ -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 {