mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
Fix mux client memory leak (#18956)
Add missing client cancellation, resulting in memory buildup tracing back to context.WithCancelCause/context.WithCancelDeadlineCause
This commit is contained in:
@@ -63,10 +63,11 @@ func (s *Stream) Send(b []byte) error {
|
||||
func (s *Stream) Results(next func(b []byte) error) (err error) {
|
||||
done := false
|
||||
defer func() {
|
||||
if s.cancel != nil {
|
||||
s.cancel(err)
|
||||
}
|
||||
|
||||
if !done {
|
||||
if s.cancel != nil {
|
||||
s.cancel(err)
|
||||
}
|
||||
// Drain channel.
|
||||
for range s.responses {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user