fromwire_bitcoin_tx: quieten leak reporting.

We create a temporary tx which is a child of the real tx, for simplicity of
marshalling.  That's OK.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2017-12-15 20:52:57 +10:30 committed by Christian Decker
parent ccb7047291
commit 795a03e8c4
5 changed files with 9 additions and 1 deletions

View File

@ -49,6 +49,7 @@ CHANNELD_COMMON_OBJS := \
common/io_debug.o \
common/keyset.o \
common/key_derive.o \
common/memleak.o \
common/msg_queue.o \
common/ping.o \
common/peer_failed.o \

View File

@ -51,6 +51,7 @@ CLOSINGD_COMMON_OBJS := \
common/dev_disconnect.o \
common/derive_basepoints.o \
common/htlc_wire.o \
common/memleak.o \
common/msg_queue.o \
common/peer_failed.o \
common/permute_tx.o \

View File

@ -2,6 +2,7 @@
#include <ccan/array_size/array_size.h>
#include <ccan/crypto/shachain/shachain.h>
#include <common/htlc_wire.h>
#include <common/memleak.h>
#include <wire/wire.h>
/* FIXME: We could adapt tools/generate-wire.py to generate structures
@ -147,6 +148,9 @@ void fromwire_bitcoin_tx(const u8 **cursor, size_t *max, struct bitcoin_tx *tx)
* for the sake of simple structures, we don't write the
* generator that way. */
struct bitcoin_tx *tx2 = pull_bitcoin_tx(tx, cursor, max);
if (tx2)
if (tx2) {
*tx = *tx2;
/* This hangs around with tx until freed */
notleak(tx2);
}
}

View File

@ -56,6 +56,7 @@ ONCHAIND_COMMON_OBJS := \
common/initial_commit_tx.o \
common/keyset.o \
common/key_derive.o \
common/memleak.o \
common/msg_queue.o \
common/permute_tx.o \
common/status.o \

View File

@ -50,6 +50,7 @@ OPENINGD_COMMON_OBJS := \
common/initial_commit_tx.o \
common/key_derive.o \
common/keyset.o \
common/memleak.o \
common/msg_queue.o \
common/ping.o \
common/peer_failed.o \