Skip to content

Commit 03ea7d9

Browse files
committed
add null prt check to _pcb in flush
1 parent 0aa5c5d commit 03ea7d9

File tree

1 file changed

+5
-4
lines changed
  • hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/include

1 file changed

+5
-4
lines changed

hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/include/ClientContext.h

+5-4
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,12 @@ class ClientContext
162162

163163
void flush()
164164
{
165-
if (!_rx_buf)
165+
if(!_rx_buf) {
166166
return;
167-
168-
size_t len = _rx_buf->tot_len;
169-
tcp_recved(_pcb, len);
167+
}
168+
if(_pcb) {
169+
tcp_recved(_pcb, (size_t) _rx_buf->tot_len);
170+
}
170171
pbuf_free(_rx_buf);
171172
_rx_buf = 0;
172173
_rx_buf_offset = 0;

0 commit comments

Comments
 (0)