9
0
Fork 0

fs: fix chdir()

chdir() allocates memory using mormalise_path(). But if path_check_prereq()
returns error than memory isn't freed.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Antony Pavlov 2011-10-18 13:48:45 +04:00 committed by Sascha Hauer
parent 74c36329c3
commit a76e310abf
1 changed files with 2 additions and 1 deletions

View File

@ -347,8 +347,9 @@ int chdir(const char *pathname)
strcpy(cwd, p);
free(p);
out:
free(p);
return errno;
}
EXPORT_SYMBOL(chdir);