diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2017-09-27 13:51:13 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-09-27 14:02:20 +0200 |
commit | 6d328ea1369f42b6a5658d548461991585534631 (patch) | |
tree | 14ce4828f1c8bbb901f983bc1a33cf28c87c685d | |
parent | 9710d39e0de75ca5fd5a5d9c6de4fe4efba31790 (diff) | |
download | barebox-6d328ea1369f42b6a5658d548461991585534631.tar.gz barebox-6d328ea1369f42b6a5658d548461991585534631.tar.xz |
file_list: Fix memory leak in failure path
In case of a parse error not only the list header has to be freed, but
also the entries. Use file_list_free() for this purpose.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | common/file-list.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/file-list.c b/common/file-list.c index e13d5af659..be8f53bd89 100644 --- a/common/file-list.c +++ b/common/file-list.c @@ -122,7 +122,7 @@ struct file_list *file_list_parse(const char *str) return files; out: - free(files); + file_list_free(files); return ERR_PTR(ret); } |