1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

add null prt check to _pcb in flush

This commit is contained in:
Markus Sattler 2015-04-06 18:49:57 +02:00
parent 96ec8e480b
commit ea7a4e522a

View File

@ -162,11 +162,12 @@ public:
void flush()
{
if (!_rx_buf)
if(!_rx_buf) {
return;
size_t len = _rx_buf->tot_len;
tcp_recved(_pcb, len);
}
if(_pcb) {
tcp_recved(_pcb, (size_t) _rx_buf->tot_len);
}
pbuf_free(_rx_buf);
_rx_buf = 0;
_rx_buf_offset = 0;