Skip to content

Commit

Permalink
Windows: Close handles - to avoid hardlink exhaustion
Browse files Browse the repository at this point in the history
  • Loading branch information
Nils Wireklint authored and EdSchouten committed Jul 8, 2024
1 parent 37cb116 commit 027b96b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/filesystem/local_directory_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ func (d *localDirectory) lstat(name path.Component) (FileType, error) {
if err != nil {
return FileTypeOther, err
}
defer windows.CloseHandle(handle)
var fileInfo windows.ByHandleFileInformation
err = windows.GetFileInformationByHandle(handle, &fileInfo)
if err != nil {
Expand Down Expand Up @@ -515,6 +516,7 @@ func (d *localDirectory) Readlink(name path.Component) (path.Parser, error) {
if err != nil {
return nil, err
}
defer windows.CloseHandle(handle)
outBufferSize := uint32(512)
outBuffer := make([]byte, outBufferSize)
var returned uint32
Expand Down

0 comments on commit 027b96b

Please sign in to comment.