Commit bd23a539 authored by Al Viro's avatar Al Viro

fix leaks in path_lookupat()

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent eddecbb6
...@@ -1644,13 +1644,16 @@ static int path_lookupat(int dfd, const char *name, ...@@ -1644,13 +1644,16 @@ static int path_lookupat(int dfd, const char *name,
err = -ECHILD; err = -ECHILD;
} }
if (!err) if (!err) {
err = handle_reval_path(nd); err = handle_reval_path(nd);
if (err)
path_put(&nd->path);
}
if (!err && nd->flags & LOOKUP_DIRECTORY) { if (!err && nd->flags & LOOKUP_DIRECTORY) {
if (!nd->inode->i_op->lookup) { if (!nd->inode->i_op->lookup) {
path_put(&nd->path); path_put(&nd->path);
return -ENOTDIR; err = -ENOTDIR;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment