From f2468963488026b7a9fa2c08a60f391195745ae8 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 7 Sep 2021 13:36:05 +0930 Subject: [PATCH] spender/openchannel.c: don't leave psbt parts owned by NULL. They get grafted into clone, so have them parented there. Otherwise we get a small leak every time we RBF. Signed-off-by: Rusty Russell --- plugins/spender/openchannel.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/spender/openchannel.c b/plugins/spender/openchannel.c index 22cbb171f..7a401cdc7 100644 --- a/plugins/spender/openchannel.c +++ b/plugins/spender/openchannel.c @@ -90,8 +90,9 @@ static bool update_parent_psbt(const tal_t *ctx, if (wally_psbt_clone_alloc(new_node_psbt, 0, &new_node_copy) != WALLY_OK) abort(); - /* copy is cleaned up below */ - tal_wally_end(NULL); + /* copy is cleaned up below, but we need parts we steal from it + * owned by the clone. */ + tal_wally_end(clone); changes = psbt_get_changeset(NULL, old_node_psbt, new_node_copy);