Skip to content

Commit 586664b

Browse files
committed
EthernetServer: return EthernetClient(nullptr) when invalid
1 parent a13a5a2 commit 586664b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ArduinoCore-Linux/cores/arduino/EthernetServer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,15 @@ class EthernetServer : public Server {
172172
// non blocking check if we have any request to accept
173173
if (!is_blocking) {
174174
if (poll_rc <= 0 || !(pfd.revents & POLLIN)) {
175-
EthernetClient result;
175+
EthernetClient result(nullptr);
176176
return result;
177177
}
178178
}
179179

180180
// accept client connection (blocking call)
181181
if ((client_fd = ::accept(server_fd, (struct sockaddr*)&client_addr,
182182
&client_addr_len)) < 0) {
183-
EthernetClient result;
183+
EthernetClient result(nullptr);
184184
Logger.error("accept failed");
185185
return result;
186186
}

0 commit comments

Comments
 (0)