mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-26 17:24:20 +01:00
memleak: explicitly exclude ccan/io allocation.
It's a single, full-lifetime allocation; make sure we only exclude that one, though this is fragile: tests will break if it moves. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
dfc132b2fe
commit
19b1b35d31
@@ -47,13 +47,21 @@ static void children_into_htable(const void *exclude,
|
||||
const tal_t *i;
|
||||
|
||||
for (i = tal_first(p); i; i = tal_next(i)) {
|
||||
const char *name = tal_name(i);
|
||||
|
||||
if (p == exclude)
|
||||
continue;
|
||||
|
||||
/* Don't add backtrace objects. */
|
||||
if (tal_name(i) && streq(tal_name(i), "backtrace"))
|
||||
continue;
|
||||
if (name) {
|
||||
/* Don't add backtrace objects. */
|
||||
if (streq(name, "backtrace"))
|
||||
continue;
|
||||
|
||||
/* ccan/io allocates pollfd array. */
|
||||
if (streq(name,
|
||||
"ccan/ccan/io/poll.c:40:struct pollfd[]"))
|
||||
continue;
|
||||
}
|
||||
htable_add(memtable, hash_ptr(i, NULL), i);
|
||||
children_into_htable(exclude, memtable, i);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user