forked from TrueCloudLab/frostfs-node
[#1062] object: Fix buffer allocation for PayloadRange
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
parent
f5b67c6735
commit
2b88361849
1 changed files with 1 additions and 1 deletions
|
@ -348,7 +348,7 @@ func PayloadRange(ctx context.Context, prm PayloadRangePrm) (*PayloadRangeRes, e
|
|||
ln = maxInitialBufferSize
|
||||
}
|
||||
|
||||
w := bytes.NewBuffer(make([]byte, ln))
|
||||
w := bytes.NewBuffer(make([]byte, 0, ln))
|
||||
_, err = io.CopyN(w, rdr, int64(prm.ln))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("read payload: %w", err)
|
||||
|
|
Loading…
Reference in a new issue