Skip to content

Commit e9389e3

Browse files
authored
Fix AsyncUDP buffer error
fixes: #2685
1 parent 0acf19a commit e9389e3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libraries/AsyncUDP/src/AsyncUDP.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -682,8 +682,9 @@ void AsyncUDP::_recv(udp_pcb *upcb, pbuf *pb, const ip_addr_t *addr, uint16_t po
682682
if(_handler) {
683683
AsyncUDPPacket packet(this, this_pb, addr, port, netif);
684684
_handler(packet);
685+
} else {
686+
pbuf_free(this_pb);
685687
}
686-
pbuf_free(this_pb);
687688
}
688689
}
689690

0 commit comments

Comments
 (0)