From 3e311b25100cab17f7a06cc8de9239d4fb49c128 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 25 Mar 2020 14:45:16 +1030 Subject: [PATCH] lightningd: fix assert() if spawning openingd fails. My node crashed as follows: lightningd: lightningd/peer_control.c:957: peer_connected: Assertion `!peer->uncommitted_channel' failed. In the logs I found: Running lightning_openingd: Cannot allocate memory Which reveals that we're not freeing uc in that path! Changelog-Fixed: Fix assertion on reconnect if we fail to run openingd. Signed-off-by: Rusty Russell --- lightningd/opening_control.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lightningd/opening_control.c b/lightningd/opening_control.c index 4654b0b63..18c42ecdf 100644 --- a/lightningd/opening_control.c +++ b/lightningd/opening_control.c @@ -977,6 +977,7 @@ void peer_start_openingd(struct peer *peer, tal_fmt(tmpctx, "Running lightning_openingd: %s", strerror(errno))); + tal_free(uc); return; }