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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2020-03-25 14:45:16 +10:30 committed by Christian Decker
parent 8c984fbf1d
commit 3e311b2510

View File

@ -977,6 +977,7 @@ void peer_start_openingd(struct peer *peer,
tal_fmt(tmpctx,
"Running lightning_openingd: %s",
strerror(errno)));
tal_free(uc);
return;
}