From 9c978f2c632e396d2e14e16fb370c9e061e56da0 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 23 Mar 2022 09:31:36 +1030 Subject: [PATCH] lightningd: free peer->uc when openingd fails. This avoids reuse which can cause confusion; the long-term fix is to rewrite this to use real channels like dualfunding does. Signed-off-by: Rusty Russell --- lightningd/opening_control.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lightningd/opening_control.c b/lightningd/opening_control.c index bc9aac4bd..8f898ee16 100644 --- a/lightningd/opening_control.c +++ b/lightningd/opening_control.c @@ -574,6 +574,8 @@ static void openingd_failed(struct subd *openingd, const u8 *msg, /* Noop if we're not funder. */ opening_funder_failed_cancel_commands(uc, desc); + /* Detaches from ->peer */ + tal_free(uc); } struct openchannel_hook_payload {