Skip to content

Commit 1bd25d9

Browse files
committed
fix: a memory leak (QOS > 0)
Signed-off-by: dawxy <97687341@qq.com>
1 parent 65f43bd commit 1bd25d9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net.go

+2
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ func alllogic(c *client) {
267267
pa := packets.NewControlPacket(packets.Puback).(*packets.PubackPacket)
268268
pa.MessageID = m.MessageID
269269
DEBUG.Println(NET, "putting puback msg on obound")
270+
persistOutbound(c.persist, pa)
270271
select {
271272
case c.oboundP <- &PacketAndToken{p: pa, t: nil}:
272273
case <-c.stop:
@@ -297,6 +298,7 @@ func alllogic(c *client) {
297298
DEBUG.Println(NET, "received pubrel, id:", m.MessageID)
298299
pc := packets.NewControlPacket(packets.Pubcomp).(*packets.PubcompPacket)
299300
pc.MessageID = m.MessageID
301+
persistOutbound(c.persist, pc)
300302
select {
301303
case c.oboundP <- &PacketAndToken{p: pc, t: nil}:
302304
case <-c.stop:

0 commit comments

Comments
 (0)