From 40ffa2c25cafb4db322e0b9b4c93d31d273dabe8 Mon Sep 17 00:00:00 2001 From: Jamie Wilkinson Date: Sun, 22 Mar 2015 11:24:08 +1100 Subject: [PATCH] Fixes a data race caused by not locking the mem.FileData for read access. --- mem/file.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mem/file.go b/mem/file.go index be3673e..9096ff0 100644 --- a/mem/file.go +++ b/mem/file.go @@ -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 }