From 7cf786f1f4c7c7a51e6493be27353fbf153c9b40 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 22 Jan 2016 06:41:46 +1030 Subject: [PATCH] pull_bitcoin_tx: allocate outputs off tx itself. All the members of the transaction should be allocated off the transaction, as they have the same lifetime. Signed-off-by: Rusty Russell --- bitcoin/tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitcoin/tx.c b/bitcoin/tx.c index b8ae8f194..56e8a6856 100644 --- a/bitcoin/tx.c +++ b/bitcoin/tx.c @@ -421,7 +421,7 @@ static struct bitcoin_tx *pull_bitcoin_tx(const tal_t *ctx, tx->fee = pull_le64(cursor, max); tx->output_count = pull_varint(cursor, max); - tx->output = tal_arr(ctx, struct bitcoin_tx_output, tx->output_count); + tx->output = tal_arr(tx, struct bitcoin_tx_output, tx->output_count); for (i = 0; i < tx->output_count; i++) pull_output(tx, cursor, max, tx->output + i); tx->lock_time = pull_le32(cursor, max);