Fixes a data race caused by not locking the mem.FileData for read access.

This commit is contained in:
Jamie Wilkinson 2015-03-22 11:24:08 +11:00
parent b28a7effac
commit 40ffa2c25c
1 changed files with 2 additions and 0 deletions

View File

@ -107,6 +107,8 @@ func (f *File) Close() error {
}
func (f *File) Name() string {
f.fileData.Lock()
defer f.fileData.Unlock()
return f.fileData.name
}