[PATCH 04/12] file_list: Fix memory leak in failure path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux