Fixed a missing block bug

Description: w.mu is locked at line 385 and unlocked at line 396. Among 5 return statements in this function, 4 are below line 396 but there is 1 return at line 387. 
Fix: Add w.mu.Unlock() before that return at line 387.
release-3.4
lzhfromustc 2019-06-28 11:27:13 -07:00 committed by GitHub
parent 948e276ca7
commit 8194aa3f03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -384,6 +384,7 @@ func (w *watcher) RequestProgress(ctx context.Context) (err error) {
w.mu.Lock()
if w.streams == nil {
w.mu.Unlock()
return fmt.Errorf("no stream found for context")
}
wgs := w.streams[ctxKey]