add allocate in Receive calls

This commit is contained in:
William Banfield
2022-11-03 15:20:41 -04:00
parent fbad107210
commit e91616c15f
11 changed files with 11 additions and 11 deletions

View File

@@ -191,7 +191,7 @@ func (memR *Reactor) ReceiveEnvelope(e p2p.Envelope) {
}
func (memR *Reactor) Receive(chID byte, peer p2p.Peer, msgBytes []byte) {
var msg *protomem.Message
msg := &protomem.Message{}
err := proto.Unmarshal(msgBytes, msg)
if err != nil {
panic(err)

View File

@@ -190,7 +190,7 @@ func (memR *Reactor) ReceiveEnvelope(e p2p.Envelope) {
}
func (memR *Reactor) Receive(chID byte, peer p2p.Peer, msgBytes []byte) {
var msg *protomem.Message
msg := &protomem.Message{}
err := proto.Unmarshal(msgBytes, msg)
if err != nil {
panic(err)