From a7294e25c36e3acbaf70cdfac1996b2cbaa3ee44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulf=20Jaenicke-R=C3=B6=C3=9Fler?= Date: Mon, 13 Mar 2017 16:49:35 +0100 Subject: [PATCH] Make sure file handle to 'node.exe' is closed after scanning for bytes --- src/nvm/arch/arch.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nvm/arch/arch.go b/src/nvm/arch/arch.go index b7a7f64..c4bf438 100644 --- a/src/nvm/arch/arch.go +++ b/src/nvm/arch/arch.go @@ -22,6 +22,9 @@ func SearchBytesInFile( path string, match string, limit int) bool { return false; } + // Close file upon return + defer file.Close() + // Allocate 1 byte array to perform the match bit := make([]byte, 1); j := 0