Skip to content

Commit

Permalink
fix buffer reuse bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaokangwang committed Jan 3, 2022
1 parent c4f850f commit 899b8fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common/net/packetaddr/packetaddr.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ func AttachAddressToPacket(data []byte, address gonet.Addr) []byte {
if err != nil {
panic(err)
}
//Incorrect buffer reuse
data = append(packetBuf.Bytes(), data...)
packetBuf.Release()
//packetBuf.Release()
return data
}

Expand Down

0 comments on commit 899b8fe

Please sign in to comment.