chdir() allocates memory using mormalise_path(). But if path_check_prereq() returns error than memory isn't freed. Signed-off-by: Antony Pavlov <antonynpavlov@xxxxxxxxx> --- fs/fs.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/fs/fs.c b/fs/fs.c index 714fc9b..f42ca36 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -347,8 +347,9 @@ int chdir(const char *pathname) strcpy(cwd, p); - free(p); out: + free(p); + return errno; } EXPORT_SYMBOL(chdir); -- 1.7.6.3 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox