From 851cbf6c83a1d2792dbadd62db746bf28471e21c Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 3 Jan 2023 15:16:52 +1030 Subject: [PATCH] memleak: prepare for htable to be a tal object. Since it gets resized during traverse, we would crash by keeping a pointer to the old one. Signed-off-by: Rusty Russell --- common/memleak.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/memleak.c b/common/memleak.c index 205e3804e..ba78029ea 100644 --- a/common/memleak.c +++ b/common/memleak.c @@ -107,6 +107,10 @@ static void children_into_htable(struct htable *memtable, const tal_t *p) if (streq(name, "tmpctx")) continue; } + /* Don't add (resizing!) memtable table! */ + if (i == memtable->table) + continue; + htable_add(memtable, hash_ptr(i, NULL), i); children_into_htable(memtable, i); }