diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c index 65d3966b1..af02b99b1 100644 --- a/lightningd/lightningd.c +++ b/lightningd/lightningd.c @@ -1117,8 +1117,11 @@ int main(int argc, char *argv[]) /*~ Now that the rpc path exists, we can start the plugins and they * can start talking to us. */ - if (!plugins_config(ld->plugins)) + if (!plugins_config(ld->plugins)) { + /* Valgrind can complain about this leak! */ + tal_free(unconnected_htlcs_in); goto stop; + } /*~ Process any HTLCs we were in the middle of when we exited, now * that plugins (who might want to know via htlc_accepted hook) are diff --git a/lightningd/peer_htlcs.c b/lightningd/peer_htlcs.c index 0ab918db9..b83a021c0 100644 --- a/lightningd/peer_htlcs.c +++ b/lightningd/peer_htlcs.c @@ -2797,7 +2797,7 @@ void fixup_htlcs_out(struct lightningd *ld) #endif /* COMPAT_V061 */ void htlcs_resubmit(struct lightningd *ld, - struct htlc_in_map *unconnected_htlcs_in) + struct htlc_in_map *unconnected_htlcs_in STEALS) { struct htlc_in *hin; struct htlc_in_map_iter ini; diff --git a/lightningd/peer_htlcs.h b/lightningd/peer_htlcs.h index 8d6167ea6..db41ccada 100644 --- a/lightningd/peer_htlcs.h +++ b/lightningd/peer_htlcs.h @@ -65,7 +65,7 @@ void htlcs_notify_new_block(struct lightningd *ld, u32 height); void fixup_htlcs_out(struct lightningd *ld); void htlcs_resubmit(struct lightningd *ld, - struct htlc_in_map *unconnected_htlcs_in); + struct htlc_in_map *unconnected_htlcs_in STEALS); /* For HTLCs which terminate here, invoice payment calls one of these. */ void fulfill_htlc(struct htlc_in *hin, const struct preimage *preimage);