mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00: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:
parent
0d1eb67f20
commit
fe7201245b
1 changed files with 6 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue