diff --git a/net/tcp/tcp_close.c b/net/tcp/tcp_close.c index bfad4df5bdd..bd421c9ea19 100644 --- a/net/tcp/tcp_close.c +++ b/net/tcp/tcp_close.c @@ -266,19 +266,7 @@ static inline int tcp_close_disconnect(FAR struct socket *psock) /* If we have a semi-permanent write buffer callback in place, then * is needs to be be nullified. * - * Commit f1ef2c6cdeb032eaa1833cc534a63b50c5058270: - * "When a socket is closed, it should make sure that any pending write - * data is sent before the FIN is sent. It already would wait for all - * sent data to be acked, however it would discard any pending write - * data that had not been sent at least once. - * - * "This change adds a check for pending write data in addition to unacked - * data. However, to be able to actually send any new data, the send - * callback must be left. The callback should be freed later when the - * socket is actually destroyed." - * - * REVISIT: Where and how exactly is s_sndcb ever freed? Is there a - * memory leak here? + * Note: the callback will be freed by tcp_free. */ psock->s_sndcb = NULL; diff --git a/net/tcp/tcp_conn.c b/net/tcp/tcp_conn.c index fdfd6df20a9..d78d7f12504 100644 --- a/net/tcp/tcp_conn.c +++ b/net/tcp/tcp_conn.c @@ -703,8 +703,8 @@ void tcp_free(FAR struct tcp_conn_s *conn) DEBUGASSERT(conn->crefs == 0); net_lock(); - /* Free remaining callbacks, actually there should be only the close - * callback left. + /* Free remaining callbacks, actually there should be only the send + * callback for CONFIG_NET_TCP_WRITE_BUFFERS is left. */ for (cb = conn->list; cb; cb = next)