mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 06:39:01 +08:00
net/can: fix possible IOB resource leak when can close
If there is data in readahead, it needs to be released; otherwise, it will cause the leakage of IOB resources Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
@@ -169,6 +169,10 @@ void can_free(FAR struct can_conn_s *conn)
|
||||
nxsem_destroy(&conn->sndsem);
|
||||
#endif
|
||||
|
||||
/* Free the readahead queue */
|
||||
|
||||
iob_free_queue(&conn->readahead);
|
||||
|
||||
/* Free the connection. */
|
||||
|
||||
NET_BUFPOOL_FREE(g_can_connections, conn);
|
||||
|
||||
Reference in New Issue
Block a user