From 942c4b60ad8957de9100808690a90102a2121653 Mon Sep 17 00:00:00 2001 From: Dragon1573 <49941141+Dragon1573@users.noreply.github.com> Date: Wed, 20 Dec 2023 23:22:19 +0800 Subject: [PATCH] Fix (firefox_windows.go): Release resources It seems `defer` keyword is using to release and close some resources. It should be added to `getFirefoxPath` function. Signed-off-by: Dragon1573 <49941141+Dragon1573@users.noreply.github.com> --- interfacer/src/browsh/firefox_windows.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interfacer/src/browsh/firefox_windows.go b/interfacer/src/browsh/firefox_windows.go index 3eb77540..d167bb40 100644 --- a/interfacer/src/browsh/firefox_windows.go +++ b/interfacer/src/browsh/firefox_windows.go @@ -22,6 +22,8 @@ func getFirefoxPath() string { if err != nil { Shutdown(fmt.Errorf("Error reading Windows registry: %w", err)) } + defer k.Close() + path, _, err := k.GetStringValue("PathToExe") if err != nil { Shutdown(fmt.Errorf("Error reading Windows registry: %w", err))