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.ha...@pengutronix.de>
---
 common/file-list.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
 }
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to