Skip to content

Commit

Permalink
Update WiFiUdp.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
mrengineer7777 authored Feb 14, 2023
1 parent 94025ed commit 8cb7da8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libraries/WiFi/src/WiFiUdp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <new> //std::nothrow
#include <lwip/sockets.h>
#include <lwip/netdb.h>
#include <errno.h>
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 8cb7da8

Please sign in to comment.