From cea15b22e3b1ca20b5b949030892bee245a8d1bc Mon Sep 17 00:00:00 2001 From: Anton Tiurin Date: Mon, 2 Feb 2015 22:56:09 +0300 Subject: [PATCH] [InMemory] Add missing mutex.RLock/RUnlock in List to protect internal map of dir struct. Signed-off-by: Anton Tiurin --- storagedriver/inmemory/driver.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/storagedriver/inmemory/driver.go b/storagedriver/inmemory/driver.go index c2be1913..861e40eb 100644 --- a/storagedriver/inmemory/driver.go +++ b/storagedriver/inmemory/driver.go @@ -194,6 +194,9 @@ func (d *Driver) List(path string) ([]string, error) { return nil, storagedriver.InvalidPathError{Path: path} } + d.mutex.RLock() + defer d.mutex.RUnlock() + normalized := normalize(path) found := d.root.find(normalized)