mqueue:fix msgq memleak
Build Documentation / build-html (push) Has been cancelled

if first call unlink after call nxmq_file_close
cause i_crefs not 0 will leak msqg, inode will
free in unlink, but forget free msgq

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
anjiahao
2025-03-19 16:37:39 +08:00
committed by Xiang Xiao
parent 2969857ff2
commit 6beaf1258f
+1 -1
View File
@@ -76,7 +76,7 @@ static int nxmq_file_close(FAR struct file *filep)
{
FAR struct inode *inode = filep->f_inode;
if (atomic_read(&inode->i_crefs) <= 0)
if (atomic_read(&inode->i_crefs) <= 1)
{
FAR struct mqueue_inode_s *msgq = inode->i_private;