mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-19 09:23:30 +08:00
[dfs]释放fd_slot之前将子节点释放避免内存泄漏 (#7378)
This commit is contained in:
parent
62dcc50530
commit
efbdeb25ee
@ -359,6 +359,11 @@ void fdt_fd_release(struct dfs_fdtable* fdt, int fd)
|
||||
if (vnode)
|
||||
{
|
||||
vnode->ref_count--;
|
||||
if(vnode->ref_count == 0)
|
||||
{
|
||||
rt_free(vnode);
|
||||
fd_slot->vnode = RT_NULL;
|
||||
}
|
||||
}
|
||||
rt_free(fd_slot);
|
||||
}
|
||||
|
@ -359,6 +359,11 @@ void fdt_fd_release(struct dfs_fdtable* fdt, int fd)
|
||||
if (vnode)
|
||||
{
|
||||
vnode->ref_count--;
|
||||
if(vnode->ref_count == 0)
|
||||
{
|
||||
rt_free(vnode);
|
||||
fd_slot->vnode = RT_NULL;
|
||||
}
|
||||
}
|
||||
rt_free(fd_slot);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user