mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 14:24:09 +01:00
pay: Fix a memory leak when retrying getroute
This commit is contained in:
parent
645b1b505b
commit
2632cddfe4
1 changed files with 4 additions and 0 deletions
|
@ -809,6 +809,10 @@ static struct command_result *payment_getroute(struct payment *p)
|
|||
const char *errstr;
|
||||
struct gossmap *gossmap;
|
||||
|
||||
/* If we retry the getroute call we might already have a route, so
|
||||
* free an eventual stale route. */
|
||||
p->route = tal_free(p->route);
|
||||
|
||||
gossmap = get_gossmap(p->plugin);
|
||||
|
||||
dst = gossmap_find_node(gossmap, p->getroute->destination);
|
||||
|
|
Loading…
Add table
Reference in a new issue