Skip to content

Commit

Permalink
fs/namei.c: fix potential memory leak in path_lookupat
Browse files Browse the repository at this point in the history
  • Loading branch information
imoseyon authored and javilonas committed May 26, 2015
1 parent d51d7b1 commit 6a13bf5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1952,7 +1952,7 @@ static int path_lookupat(int dfd, const char *name,
err = path_init(dfd, name, flags | LOOKUP_PARENT, nd, &base);

if (unlikely(err))
return err;
goto out;

current->total_link_count = 0;
err = link_path_walk(name, nd);
Expand Down Expand Up @@ -1984,6 +1984,7 @@ static int path_lookupat(int dfd, const char *name,
}
}

out:
if (base)
fput(base);

Expand Down

0 comments on commit 6a13bf5

Please sign in to comment.