diff --git a/codec.go b/codec.go index c68ec375..0ff86440 100644 --- a/codec.go +++ b/codec.go @@ -162,6 +162,11 @@ func Unmarshal(data []byte) (*Message, error) { } arena := MultiSegment(nil) + + // We cannot return the data parameter to the bufferpool because we + // don't know where it came from. + arena.bp = nil + if err := arena.demux(hdr, data); err != nil { return nil, exc.WrapError("unmarshal", err) }