Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lixizan committed Nov 16, 2023
1 parent ff53399 commit dcd39f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contrib/pb/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ func Decode(r io.Reader, v any) error {
var buffer = internal.GetBuffer()
var p = buffer.Bytes()[:internal.BufferSize]
_, _ = io.CopyBuffer(w, r, p)
var err = errors.WithStack(proto.Unmarshal(w.B, message))
internal.PutBuffer(buffer)
bytebufferpool.Put(w)
return errors.WithStack(proto.Unmarshal(w.B, message))
return err
}

0 comments on commit dcd39f8

Please sign in to comment.