From c01982e5dde4e0d8e07e58657aaf6cd5b3770166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Sat, 28 Sep 2024 21:14:34 +0200 Subject: [PATCH] initiate: close event log handle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan-Otto Kröpke --- 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 {