Make sure we unlock only if we did not acquire

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2023-08-31 08:09:16 -07:00
parent b25b4f2cff
commit 9e26574707

View File

@@ -3509,7 +3509,9 @@ func (fs *fileStore) removeMsg(seq uint64, secure, viaLimits, needFSLock bool) (
}
cb := fs.scb
fsUnlock()
if !needFSLock {
fs.mu.Unlock()
}
// Storage updates.
if cb != nil {