Skip to content

Commit b0ec0e7

Browse files
committed
WiFiClient: properly close socket on stop()
1 parent 8c24e5a commit b0ec0e7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libraries/WiFi/src/WiFiClient.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ void arduino::WiFiClient::flush() {
119119

120120
void arduino::WiFiClient::stop() {
121121
sock->close();
122+
delete sock;
123+
sock = NULL;
122124
}
123125

124126
uint8_t arduino::WiFiClient::connected() {

0 commit comments

Comments
 (0)