From aa62d79db24785223358d07c985ae277e1eeb1bd Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 24 Aug 2018 14:50:06 +0930 Subject: [PATCH] subd: fix false positive if we're inside a subd_req. We're going to call out to subds for memleak detection, and the disabler looks like a memleak if we're inside a callback. Signed-off-by: Rusty Russell --- lightningd/subd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lightningd/subd.c b/lightningd/subd.c index 0db43ea96..4f7f791f6 100644 --- a/lightningd/subd.c +++ b/lightningd/subd.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -91,7 +92,7 @@ static void add_req(const tal_t *ctx, * case where ctx is freed between request and reply. Hence this * trick. */ if (ctx) { - sr->disabler = tal(ctx, char); + sr->disabler = notleak(tal(ctx, char)); tal_add_destructor2(sr->disabler, disable_cb, sr); } else sr->disabler = NULL;