fs/vfs/fs_close.c: avoid double free if CONFIG_FS_NOTIFY is set
Double free occurred in lib_put_pathbuffer if CONFIG_FS_NOTIFY option was enabled. The second if statement has to be called only if the close operation returned error. The bug was introduced in 14f5c48 and was causing misc/lib_tempbuffer.c:141 debug assertion. Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This commit is contained in:
parent
81f27bd602
commit
01bfa1a500
1 changed files with 1 additions and 2 deletions
|
|
@ -139,9 +139,8 @@ int file_close(FAR struct file *filep)
|
|||
|
||||
inode_release(inode);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FS_NOTIFY
|
||||
if (path != NULL)
|
||||
else if (path != NULL)
|
||||
{
|
||||
lib_put_pathbuffer(path);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue