From ea71e9fe5bbb61f6fb9ba40a83680f1e02dffc84 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sat, 26 Feb 2022 14:36:36 +1030 Subject: [PATCH] memleak: fix handling of notleak pointers. We were ignoring the *parent* of the notleak pointers, not the notleak pointer itself! Signed-off-by: Rusty Russell --- common/memleak.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/memleak.c b/common/memleak.c index bdff9db08..0c698e747 100644 --- a/common/memleak.c +++ b/common/memleak.c @@ -271,11 +271,11 @@ static void call_memleak_helpers(struct htable *memtable, const tal_t *p) const struct memleak_helper *mh = i; mh->cb(memtable, p); } else if (name && strends(name, " **NOTLEAK**")) { - pointer_referenced(memtable, p); - memleak_remove_region(memtable, p, tal_bytelen(p)); + pointer_referenced(memtable, i); + memleak_remove_region(memtable, i, tal_bytelen(i)); } else if (name && strends(name, " **NOTLEAK_IGNORE_CHILDREN**")) { - remove_with_children(memtable, p); - memleak_remove_region(memtable, p, tal_bytelen(p)); + remove_with_children(memtable, i); + memleak_remove_region(memtable, i, tal_bytelen(i)); } else if (name && strends(name, "_notleak")) { pointer_referenced(memtable, i); call_memleak_helpers(memtable, i);