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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-08-24 14:50:06 +09:30
committed by Christian Decker
parent 112b7336a3
commit 37ea0d3c7f

View File

@@ -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. */