diff --git a/weed/server/filer_server_handlers_write_upload.go b/weed/server/filer_server_handlers_write_upload.go index cb16eadc3..fce2a6413 100644 --- a/weed/server/filer_server_handlers_write_upload.go +++ b/weed/server/filer_server_handlers_write_upload.go @@ -102,12 +102,12 @@ func (fs *FilerServer) uploadReaderToChunks(reader io.Reader, startOffset int64, wg.Add(1) go func(offset int64, buf *bytes.Buffer) { defer func() { - bufPool.Put(bytesBuffer) + bufPool.Put(buf) <-bytesBufferLimitChan wg.Done() }() - chunks, toChunkErr := fs.dataToChunk(fileName, contentType, bytesBuffer.Bytes(), offset, so) + chunks, toChunkErr := fs.dataToChunk(fileName, contentType, buf.Bytes(), offset, so) if toChunkErr != nil { uploadErrLock.Lock() if uploadErr == nil {