Browse Source

Fixed nc_sent possible bad ptr on close issue

Joseph Henry 9 years ago
parent
commit
f2cc144811
1 changed files with 1 additions and 1 deletions
  1. 1 1
      netcon/NetconEthernetTap.cpp

+ 1 - 1
netcon/NetconEthernetTap.cpp

@@ -804,7 +804,7 @@ err_t NetconEthernetTap::nc_poll(void* arg, struct tcp_pcb *PCB)
 err_t NetconEthernetTap::nc_sent(void* arg, struct tcp_pcb *PCB, u16_t len)
 err_t NetconEthernetTap::nc_sent(void* arg, struct tcp_pcb *PCB, u16_t len)
 {
 {
 	Larg *l = (Larg*)arg;
 	Larg *l = (Larg*)arg;
-	if(len) {
+	if(l->conn && len) {
 		float max = (float)DEFAULT_BUF_SZ;
 		float max = (float)DEFAULT_BUF_SZ;
 		if(l->conn->txsz < max / 2) {
 		if(l->conn->txsz < max / 2) {
 			l->tap->_phy.setNotifyReadable(l->conn->sock, true);
 			l->tap->_phy.setNotifyReadable(l->conn->sock, true);