Add missing unlock on early return

This commit is contained in:
Fabian Reinartz 2017-09-18 11:23:22 +02:00
parent 99d39174f6
commit ab8d9b9706
1 changed files with 1 additions and 0 deletions

View File

@ -1023,6 +1023,7 @@ func (s *stripeSeries) getOrSet(hash uint64, series *memSeries) (*memSeries, boo
s.locks[i].Lock() s.locks[i].Lock()
if prev := s.hashes[i].get(hash, series.lset); prev != nil { if prev := s.hashes[i].get(hash, series.lset); prev != nil {
s.locks[i].Unlock()
return prev, false return prev, false
} }
s.hashes[i].set(hash, series) s.hashes[i].set(hash, series)