From d8109dc49becf9dbfb749e618b0cd8e48e0a57fb Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Fri, 8 Apr 2022 08:00:37 +0200 Subject: [PATCH] Add missing close when reading CSV file Signed-off-by: Evan Lezar --- internal/discover/csv/csv.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/discover/csv/csv.go b/internal/discover/csv/csv.go index f3625571..997b6fc0 100644 --- a/internal/discover/csv/csv.go +++ b/internal/discover/csv/csv.go @@ -87,6 +87,8 @@ func ParseFile(logger *logrus.Logger, filename string) ([]*MountSpec, error) { if err != nil { return nil, fmt.Errorf("failed to open %v for reading: %v", filename, err) } + defer csvFile.Close() + return parseCSVFromReader(logger, csvFile), nil }