mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-23 07:08:24 +00:00
Don't leak fd
This commit is contained in:
parent
ebec4fbc24
commit
e7f60161a3
@ -39,15 +39,7 @@ type Staggered struct {
|
||||
|
||||
// Check if file or dir
|
||||
func isFile(path string) bool {
|
||||
fileordir := path
|
||||
file, err := os.Open(fileordir)
|
||||
if err != nil {
|
||||
l.Infoln("versioner isFile:", err)
|
||||
return false
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
fileInfo, err := file.Stat()
|
||||
fileInfo, err := os.Stat(path)
|
||||
if err != nil {
|
||||
l.Infoln("versioner isFile:", err)
|
||||
return false
|
||||
|
Loading…
x
Reference in New Issue
Block a user