[dfs]释放fd_slot之前将子节点释放避免内存泄漏 (#7378)

This commit is contained in:
goldengrandpa authored and GitHub committed 2023-04-26 08:47:21 +08:00
1 parent 62dcc50530
commit efbdeb25ee
2 files changed
+10

No files matched your search

+5
View File
@@ -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);
}
+5
View File
@@ -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);
}