From e9389e3122fc47227f961eaaa6541380ef4f2b0c Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Mon, 13 May 2019 23:18:38 +0300 Subject: [PATCH] Fix AsyncUDP buffer error fixes: https://github.com/espressif/arduino-esp32/issues/2685 --- libraries/AsyncUDP/src/AsyncUDP.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/AsyncUDP/src/AsyncUDP.cpp b/libraries/AsyncUDP/src/AsyncUDP.cpp index 63ccc114..762529b9 100644 --- a/libraries/AsyncUDP/src/AsyncUDP.cpp +++ b/libraries/AsyncUDP/src/AsyncUDP.cpp @@ -682,8 +682,9 @@ void AsyncUDP::_recv(udp_pcb *upcb, pbuf *pb, const ip_addr_t *addr, uint16_t po if(_handler) { AsyncUDPPacket packet(this, this_pb, addr, port, netif); _handler(packet); + } else { + pbuf_free(this_pb); } - pbuf_free(this_pb); } }