diff --git a/src/api/api_msg.c b/src/api/api_msg.c index 023a4781..c6be8653 100644 --- a/src/api/api_msg.c +++ b/src/api/api_msg.c @@ -806,9 +806,6 @@ static void netconn_drain(struct netconn *conn) { void *mem; -#if LWIP_TCP - struct pbuf *p; -#endif /* LWIP_TCP */ /* This runs in tcpip_thread, so we don't need to lock against rx packets */ @@ -819,12 +816,7 @@ netconn_drain(struct netconn *conn) if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP) { err_t err; if (!lwip_netconn_is_err_msg(mem, &err)) { - p = (struct pbuf *)mem; - /* pcb might be set to NULL already by err_tcp() */ - if (conn->pcb.tcp != NULL) { - tcp_recved(conn->pcb.tcp, p->tot_len); - } - pbuf_free(p); + pbuf_free((struct pbuf *)mem); } } else #endif /* LWIP_TCP */