mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-06 07:34:21 +01:00
json_getroute: don't leak.
Allocate the route off the current command, not dstate. And in the case where the route is somehow not via a peer, don't leak memory. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -241,7 +241,8 @@ static void json_getroute(struct command *cmd,
|
||||
return;
|
||||
}
|
||||
|
||||
peer = find_route(cmd->dstate, &id, msatoshi, riskfactor, &fee, &route);
|
||||
peer = find_route(cmd, cmd->dstate, &id, msatoshi, riskfactor,
|
||||
&fee, &route);
|
||||
if (!peer) {
|
||||
command_fail(cmd, "no route found");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user