mirror of
https://github.com/apache/nuttx.git
synced 2026-02-06 12:42:21 +08:00
tmpfs:fix memoryleak of tmpfs_opendir
fix the memory leak in tmpfs_opendir Signed-off-by: guohao15 <guohao15@xiaomi.com>
This commit is contained in:
@@ -2047,14 +2047,18 @@ static int tmpfs_opendir(FAR struct inode *mountpt, FAR const char *relpath,
|
||||
{
|
||||
tdir->tf_tdo = tdo;
|
||||
tdir->tf_index = tdo->tdo_nentries;
|
||||
|
||||
*dir = &tdir->tf_base;
|
||||
tmpfs_unlock_directory(tdo);
|
||||
}
|
||||
|
||||
/* Release the lock on the file system and return the result */
|
||||
|
||||
tmpfs_unlock(fs);
|
||||
*dir = &tdir->tf_base;
|
||||
if (ret < 0)
|
||||
{
|
||||
fs_heap_free(tdir);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user