[PATCH 2/3] stringlist: Initialize HEAD str member to NULL

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

 



HEAD str member should be unused, but when it's used accidently then at
least make sure we do not use an uninitialized string.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 include/stringlist.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/stringlist.h b/include/stringlist.h
index dbf159da91..c5d6e70a36 100644
--- a/include/stringlist.h
+++ b/include/stringlist.h
@@ -19,6 +19,7 @@ void string_list_print_by_column(struct string_list *sl);
 static inline void string_list_init(struct string_list *sl)
 {
 	INIT_LIST_HEAD(&sl->list);
+	sl->str = NULL;
 }
 
 static inline void string_list_free(struct string_list *sl)
-- 
2.29.2


_______________________________________________
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