net/inet: Fix a memory leak when closing a TCP socket.
This commit is contained in:
parent
f3286d83e7
commit
63a8d79553
|
@ -348,7 +348,11 @@ static inline int tcp_close_disconnect(FAR struct socket *psock)
|
||||||
* release it now.
|
* release it now.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
psock->s_sndcb = NULL;
|
if (psock->s_sndcb != NULL)
|
||||||
|
{
|
||||||
|
tcp_callback_free(conn, psock->s_sndcb);
|
||||||
|
psock->s_sndcb = NULL;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Check for the case where the host beat us and disconnected first */
|
/* Check for the case where the host beat us and disconnected first */
|
||||||
|
|
Loading…
Reference in New Issue