Skip to content

Commit 8cb7da8

Browse files
Update WiFiUdp.cpp
1 parent 94025ed commit 8cb7da8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libraries/WiFi/src/WiFiUdp.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
License along with this library; if not, write to the Free Software
1717
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
19+
1920
#include "WiFiUdp.h"
21+
#include <new> //std::nothrow
2022
#include <lwip/sockets.h>
2123
#include <lwip/netdb.h>
2224
#include <errno.h>
@@ -222,7 +224,7 @@ int WiFiUDP::parsePacket(){
222224
remote_ip = IPAddress(si_other.sin_addr.s_addr);
223225
remote_port = ntohs(si_other.sin_port);
224226
if (len > 0) {
225-
rx_buffer = new cbuf(len);
227+
rx_buffer = new(std::nothrow) cbuf(len);
226228
rx_buffer->write(buf, len);
227229
}
228230
free(buf);

0 commit comments

Comments
 (0)