From e58a81a861ab3e6593b6f4962256f45d3da781aa Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sat, 25 Sep 2010 22:04:16 +0930 Subject: [PATCH] alloc: fix uninitialized entry (thanks valgrind!) --- ccan/alloc/alloc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ccan/alloc/alloc.c b/ccan/alloc/alloc.c index 8e0b72aa..6cd96d8d 100644 --- a/ccan/alloc/alloc.c +++ b/ccan/alloc/alloc.c @@ -489,6 +489,8 @@ static unsigned long break_up_large_page(struct header *head, for (i = 1; i < SMALL_PAGES_PER_LARGE_PAGE; i++) { struct page_header *ph = from_pgnum(head, lpage + i, sp_bits); + /* Initialize this: huge_alloc reads it. */ + ph->elements_used = 0; add_small_page_to_freelist(head, ph, sp_bits); } -- 2.39.2