Skip to content

Commit a54a0ee

Browse files
authored
Fix change
1 parent 91680c2 commit a54a0ee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libraries/WiFi/src/WiFiUdp.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,12 @@ int WiFiUDP::parsePacket(){
288288
struct sockaddr_storage si_other_storage; // enough storage for v4 and v6
289289
socklen_t slen = sizeof(sockaddr_storage);
290290
int len;
291-
char * buf = new char[1460];
292-
if(!buf){
291+
char *buf = (char *)malloc(1460);
292+
if(!buf) {
293293
return 0;
294294
}
295295
if ((len = recvfrom(udp_server, buf, 1460, MSG_DONTWAIT, (struct sockaddr *) &si_other_storage, (socklen_t *)&slen)) == -1){
296-
delete[] buf;
296+
free(buf);
297297
if(errno == EWOULDBLOCK){
298298
return 0;
299299
}

0 commit comments

Comments
 (0)