We already handle normal free traversal loops, just not ones caused by a
direct tal_free() call, such a calling tal_free() on one's own parent.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
struct tal_hdr *t;
int saved_errno = errno;
t = debug_tal(to_tal_hdr(ctx));
struct tal_hdr *t;
int saved_errno = errno;
t = debug_tal(to_tal_hdr(ctx));
+ if (unlikely(get_destroying_bit(t->parent_child)))
+ return NULL;
if (notifiers)
notify(ignore_destroying_bit(t->parent_child)->parent,
TAL_NOTIFY_DEL_CHILD, ctx, saved_errno);
if (notifiers)
notify(ignore_destroying_bit(t->parent_child)->parent,
TAL_NOTIFY_DEL_CHILD, ctx, saved_errno);