From 6109132e37943eb99b8456d169b7928ff1cc5e8c Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 25 Feb 2022 15:00:15 +1030 Subject: [PATCH] memleak: fix handling of excluded pointers. We often hand an exclude pointer (usually the current command) to memleak. But when we encountered this we would stop iterating, rather than just ignore it: this means we would often ignore significant siblings. In particular, fixing this (which has always been there) reveals many previously-undetected leaks. Signed-off-by: Rusty Russell --- common/memleak.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/memleak.c b/common/memleak.c index 0c698e747a54..68fe64f74892 100644 --- a/common/memleak.c +++ b/common/memleak.c @@ -79,7 +79,7 @@ static void children_into_htable(const void *exclude1, const void *exclude2, const char *name = tal_name(i); if (i == exclude1 || i == exclude2) - return; + continue; if (name) { /* Don't add backtrace objects. */