fs: pseudorename should call inode_release in the error path

to avoid the memory leak

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I8f7e4c8fb89188614d03dcf383a1707f25c65174
This commit is contained in:
Xiang Xiao
2021-07-09 15:46:02 +08:00
committed by xiaoxiang
parent 78b5e4c657
commit 5398821b6c
+2
View File
@@ -88,6 +88,7 @@ next_subdir:
if (oldinode == newinode)
{
inode_release(newinode);
ret = OK;
goto errout; /* Bad naming, this is not an error case. */
}
@@ -130,6 +131,7 @@ next_subdir:
if (subdir == NULL)
{
inode_release(newinode);
ret = -ENOMEM;
goto errout;
}