From: Al Viro Date: Wed, 23 Mar 2011 13:56:30 +0000 (-0400) Subject: fix leaks in path_lookupat() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bd23a539d0733c9f9ec3f9fc628491fad2658e82;p=linux-beck.git fix leaks in path_lookupat() Signed-off-by: Al Viro --- diff --git a/fs/namei.c b/fs/namei.c index 5a9a6c3094da..a4dfac650c3c 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1644,13 +1644,16 @@ static int path_lookupat(int dfd, const char *name, err = -ECHILD; } - if (!err) + if (!err) { err = handle_reval_path(nd); + if (err) + path_put(&nd->path); + } if (!err && nd->flags & LOOKUP_DIRECTORY) { if (!nd->inode->i_op->lookup) { path_put(&nd->path); - return -ENOTDIR; + err = -ENOTDIR; } }