Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Commit

Permalink
Nil pointer dereference when cache key already evicted
Browse files Browse the repository at this point in the history
Signed-off-by: Xavier Lucas <xavier.lucas@corp.ovh.com>
  • Loading branch information
Xavier Lucas committed Feb 22, 2016
1 parent 8d60e75 commit 0259aef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion svfs/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ func (c *Cache) key(container, path string) string {
}

func (c *Cache) Delete(container, path string) {
if !c.content[c.key(container, path)].temporary {
_, found := c.content[c.key(container, path)]
if found &&
!c.content[c.key(container, path)].temporary {
c.nodeCount -= uint64(len(c.content[c.key(container, path)].list))
}
delete(c.content, c.key(container, path))
Expand Down

0 comments on commit 0259aef

Please sign in to comment.