diff --git a/common/configdir.c b/common/configdir.c index 15027e03b..e47777625 100644 --- a/common/configdir.c +++ b/common/configdir.c @@ -122,6 +122,9 @@ static void parse_include(const char *filename, bool must_exist, bool early, /* Only valid forms are "foo" and "foo=bar" */ all_args[i] = tal_fmt(all_args, "--%s", lines[i]); } + /* This isn't a leak either */ + if (all_args[i]) + tal_set_name(all_args[i], TAL_LABEL(config_notleak, "")); } /* diff --git a/common/memleak.c b/common/memleak.c index 84c3bb6f7..13e336996 100644 --- a/common/memleak.c +++ b/common/memleak.c @@ -77,10 +77,6 @@ static void children_into_htable(const void *exclude1, const void *exclude2, if (strends(name, "struct io_plan *[]") && !tal_parent(i)) continue; - /* Other notleak internals. */ - if (strends(name, "_notleak")) - continue; - /* Don't add tmpctx. */ if (streq(name, "tmpctx")) continue; @@ -244,6 +240,9 @@ static void call_memleak_helpers(struct htable *memtable, const tal_t *p) else pointer_referenced(memtable, p); memleak_scan_region(memtable, p, tal_bytelen(p)); + } else if (name && strends(name, "_notleak")) { + pointer_referenced(memtable, i); + call_memleak_helpers(memtable, i); } else { call_memleak_helpers(memtable, i); }