mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-07 08:04:23 +01:00
lightningd/jsonrpc: don't assume the jcon to be alive at command execution
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
This commit is contained in:
committed by
Christian Decker
parent
2900da6112
commit
3e9fcc43f9
@@ -597,8 +597,10 @@ static struct command_result *command_exec(struct json_connection *jcon,
|
||||
if (res == &pending)
|
||||
assert(cmd->pending);
|
||||
|
||||
list_for_each(&jcon->commands, cmd, list)
|
||||
assert(cmd->pending);
|
||||
/* The command might outlive the connection. */
|
||||
if (jcon)
|
||||
list_for_each(&jcon->commands, cmd, list)
|
||||
assert(cmd->pending);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user