From 37ea0d3c7f828690c2af7796043501f419981ff0 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 24 Aug 2018 14:50:06 +0930 Subject: [PATCH] memleak: fix exclude check. We want to exclude the child from being entered into the htable: if we wanted the parent we could do this outside the loop. Signed-off-by: Rusty Russell --- common/memleak.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/memleak.c b/common/memleak.c index 88059d1b0..368360961 100644 --- a/common/memleak.c +++ b/common/memleak.c @@ -78,8 +78,8 @@ static void children_into_htable(const void *exclude1, const void *exclude2, for (i = tal_first(p); i; i = tal_next(i)) { const char *name = tal_name(i); - if (p == exclude1 || p == exclude2) - continue; + if (i == exclude1 || i == exclude2) + return; if (name) { /* Don't add backtrace objects. */