mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-15 20:09:18 +01:00
lightningd: fix fd leak with check command on openchannel_init.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
45b298fca4
commit
5a1e511a85
1 changed files with 3 additions and 3 deletions
|
@ -3133,15 +3133,15 @@ static struct command_result *json_openchannel_init(struct command *cmd,
|
|||
type_to_string(tmpctx, struct wally_psbt,
|
||||
psbt));
|
||||
|
||||
if (command_check_only(cmd))
|
||||
return command_check_done(cmd);
|
||||
|
||||
if (socketpair(AF_LOCAL, SOCK_STREAM, 0, fds) != 0) {
|
||||
return command_fail(cmd, FUND_MAX_EXCEEDED,
|
||||
"Failed to create socketpair: %s",
|
||||
strerror(errno));
|
||||
}
|
||||
|
||||
if (command_check_only(cmd))
|
||||
return command_check_done(cmd);
|
||||
|
||||
/* Now we can't fail, create channel */
|
||||
channel = new_unsaved_channel(peer,
|
||||
peer->ld->config.fee_base,
|
||||
|
|
Loading…
Add table
Reference in a new issue