diff options
author | Antony Pavlov <antonynpavlov@gmail.com> | 2011-10-18 13:48:45 +0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-10-18 12:12:43 +0200 |
commit | a76e310abf6a82154dd6a1161a1883c031ec9652 (patch) | |
tree | 6b5812fdff690dc624fb53e9eaf7d98209f6b13c | |
parent | 74c36329c3531acf59d76a09cd0c4cf11ce6b6a0 (diff) | |
download | barebox-a76e310abf6a82154dd6a1161a1883c031ec9652.tar.gz barebox-a76e310abf6a82154dd6a1161a1883c031ec9652.tar.xz |
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>
-rw-r--r-- | fs/fs.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -347,8 +347,9 @@ int chdir(const char *pathname) strcpy(cwd, p); - free(p); out: + free(p); + return errno; } EXPORT_SYMBOL(chdir); |