Skip to content

Commit 022ea5a

Browse files
d-a-vdevyte
authored andcommitted
consequence of ::flush() update: fix potential double free (#3990)
1 parent f8b577b commit 022ea5a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libraries/ESP8266WiFi/src/include/UdpContext.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ class UdpContext
288288
data_size -= will_copy;
289289
}
290290
}
291-
pbuf_free(_tx_buf_head);
291+
if (_tx_buf_head)
292+
pbuf_free(_tx_buf_head);
292293
_tx_buf_head = 0;
293294
_tx_buf_cur = 0;
294295
_tx_buf_offset = 0;

0 commit comments

Comments
 (0)