tcp: fix coverity warning for tcp_timer

use after free when the number of retransmissions reached the maximum.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu 2023-03-27 21:11:03 +08:00 committed by Xiang Xiao
parent c3ccc30f83
commit 1389a686ba

View File

@ -553,7 +553,7 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn)
conn->crefs = 0;
tcp_free(conn);
goto done;
return;
}
/* Otherwise, check for a timeout on an established connection.