channeld: plug minor leak.

We don't free the signatures in this case, and for some reason leak checking
on my build machine just found it:

MEMLEAK: 0x560f7dc69fc8'
   label=channeld/gen_channel_wire.c:266:secp256k1_ecdsa_signature'
  backtrace:'
    ccan/ccan/tal/tal.c:442 (tal_alloc_)'
    channeld/gen_channel_wire.c:266 (fromwire_channel_init)'
    channeld/channeld.c:3060 (init_channel)'
    channeld/channeld.c:3254 (main)'
  parents:'
    channeld/channeld.c:3227:struct peer'
MEMLEAK: 0x560f7dc6a288'
  label=channeld/gen_channel_wire.c:272:secp256k1_ecdsa_signature'
  backtrace:'
    ccan/ccan/tal/tal.c:442 (tal_alloc_)'
    channeld/gen_channel_wire.c:272 (fromwire_channel_init)'
    channeld/channeld.c:3060 (init_channel)'
    channeld/channeld.c:3254 (main)'
  parents:'
    channeld/channeld.c:3227:struct peer'

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2020-04-03 13:51:27 +10:30
parent 3b4a06f52b
commit 2e8257e1e6

View File

@ -3100,6 +3100,8 @@ static void init_channel(struct peer *peer)
* it directly!
*/
peer->short_channel_ids[REMOTE] = peer->short_channel_ids[LOCAL];
tal_free(remote_ann_node_sig);
tal_free(remote_ann_bitcoin_sig);
}
/* First commit is used for opening: if we've sent 0, we're on