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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2016-01-22 06:41:46 +10:30
parent 3a803eefbb
commit 7cf786f1f4

View File

@ -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);