Fix tcp pcb access after it was freed in tcp.c - found by Coverity

This commit is contained in:
Dirk Ziegelmeier 2016-02-19 23:28:09 +01:00
parent bbb5e99f25
commit 10edba936b

View File

@ -611,7 +611,7 @@ tcp_listen_dual_with_backlog(struct tcp_pcb *pcb, u8_t backlog)
lpcb = tcp_listen_with_backlog(pcb, backlog); lpcb = tcp_listen_with_backlog(pcb, backlog);
if ((lpcb != NULL) && if ((lpcb != NULL) &&
ip_addr_isany(&pcb->local_ip)) { ip_addr_isany(&lpcb->local_ip)) {
/* The default behavior is to accept connections on either /* The default behavior is to accept connections on either
* IPv4 or IPv6, if not bound. */ * IPv4 or IPv6, if not bound. */
/* @see NETCONN_FLAG_IPV6_V6ONLY for changing this behavior */ /* @see NETCONN_FLAG_IPV6_V6ONLY for changing this behavior */