From 39f4ca98b5bebbbcb4ed7fc53a7601f09c174bcc Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 2 Dec 2020 10:39:04 +1030 Subject: [PATCH] common: check for outstanding taken() pointers in common_shutdown. Signed-off-by: Rusty Russell --- common/setup.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/setup.c b/common/setup.c index 1b8357c74..55281f458 100644 --- a/common/setup.c +++ b/common/setup.c @@ -44,6 +44,10 @@ void common_setup(const char *argv0) void common_shutdown(void) { + const char *p = taken_any(); + if (p) + errx(1, "outstanding taken(): %s", p); + take_cleanup(); tal_free(tmpctx); wally_cleanup(0); tal_free(wally_tal_ctx);