From 1e4bb328da37ba915dfb8d5a07cc2a4ecad4c9a0 Mon Sep 17 00:00:00 2001 From: David McCurley <44048235+mrengineer7777@users.noreply.github.com> Date: Tue, 14 Feb 2023 17:14:34 -0600 Subject: [PATCH] Update WiFiUdp.cpp --- libraries/WiFi/src/WiFiUdp.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/WiFi/src/WiFiUdp.cpp b/libraries/WiFi/src/WiFiUdp.cpp index 2d70c04fb27..556f9a8afcc 100644 --- a/libraries/WiFi/src/WiFiUdp.cpp +++ b/libraries/WiFi/src/WiFiUdp.cpp @@ -16,7 +16,9 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + #include "WiFiUdp.h" +#include //std::nothrow #include #include #include @@ -222,7 +224,7 @@ int WiFiUDP::parsePacket(){ remote_ip = IPAddress(si_other.sin_addr.s_addr); remote_port = ntohs(si_other.sin_port); if (len > 0) { - rx_buffer = new cbuf(len); + rx_buffer = new(std::nothrow) cbuf(len); rx_buffer->write(buf, len); } free(buf);