Skip to content

Commit a6a5fc9

Browse files
committed
Fix leaked os.Root handle in fileSource.Read
Assisted-By: cagent
1 parent a136679 commit a6a5fc9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

pkg/config/sources.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ func (a fileSource) Read(context.Context) ([]byte, error) {
5555
if err != nil {
5656
return nil, fmt.Errorf("opening filesystem %s: %w", parentDir, err)
5757
}
58+
defer fs.Close()
5859

5960
fileName := filepath.Base(a.path)
6061
data, err := fs.ReadFile(fileName)

0 commit comments

Comments
 (0)