login_test: fix minor memory leak

defer PutBuffer so that the event packet is returned to the pool
This commit is contained in:
CPunch 2023-12-07 21:37:16 -06:00
parent 2bd61dc571
commit 23170093ee

View File

@ -63,8 +63,9 @@ func sendAndRecv(peer *cnet.Peer, recv chan *cnet.PacketEvent, is *is.I, sID, rI
// receive response
evnt := <-recv
is.Equal(evnt.PktID, rID) // should receive expected type
defer protocol.PutBuffer(evnt.Pkt)
is.Equal(evnt.PktID, rID) // should receive expected type
is.NoErr(protocol.NewPacket(evnt.Pkt).Decode(in)) // packet.Decode() should not return an error
}