mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 03:45:50 +08:00
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:
+1
-2
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user