From 0ab38177156de77c0e21c9788bd5452228d2a1c5 Mon Sep 17 00:00:00 2001 From: trueptolemy Date: Sat, 17 Aug 2019 01:01:26 +0800 Subject: [PATCH] common: Fix a memleak in `withdraw_tx` --- common/withdraw_tx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/withdraw_tx.c b/common/withdraw_tx.c index 2f6c52af4..20a6c9336 100644 --- a/common/withdraw_tx.c +++ b/common/withdraw_tx.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -29,7 +30,7 @@ struct bitcoin_tx *withdraw_tx(const tal_t *ctx, const void *map[2]; map[0] = int2ptr(0); map[1] = int2ptr(1); - bitcoin_tx_add_output(tx, scriptpubkey_p2wpkh(tx, changekey), + bitcoin_tx_add_output(tx, scriptpubkey_p2wpkh(tmpctx, changekey), change); permute_outputs(tx, NULL, map); if (change_outnum)