mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
common/utxo: don't memleak script.
We currently always free the tx, so we didn't notice, but the coming changes uncovered this leak. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
0543149b89
commit
ffa84637ea
@ -1,5 +1,6 @@
|
||||
#include <bitcoin/script.h>
|
||||
#include <common/key_derive.h>
|
||||
#include <common/utils.h>
|
||||
#include <common/utxo.h>
|
||||
#include <wire/wire.h>
|
||||
|
||||
@ -60,7 +61,7 @@ struct bitcoin_tx *tx_spending_utxos(const tal_t *ctx,
|
||||
for (size_t i = 0; i < tal_count(utxos); i++) {
|
||||
if (utxos[i]->is_p2sh && bip32_base) {
|
||||
bip32_pubkey(bip32_base, &key, utxos[i]->keyindex);
|
||||
script = bitcoin_scriptsig_p2sh_p2wpkh(tx, &key);
|
||||
script = bitcoin_scriptsig_p2sh_p2wpkh(tmpctx, &key);
|
||||
} else {
|
||||
script = NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user