mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 10:46:58 +01:00
plugin: Fix memory leak when requests are done
We weren't cleaning the requests we fulfilled, so this does that :-)
This commit is contained in:
parent
3ba751797b
commit
a4ded47d34
1 changed files with 3 additions and 0 deletions
|
@ -178,6 +178,9 @@ static bool plugin_read_json_one(struct plugin *plugin)
|
|||
request->toks = toks;
|
||||
request->cb(request, request->arg);
|
||||
|
||||
tal_free(request);
|
||||
uintmap_del(&plugin->plugins->pending_requests, id);
|
||||
|
||||
/* Move this object out of the buffer */
|
||||
memmove(plugin->buffer, plugin->buffer + toks[0].end,
|
||||
tal_count(plugin->buffer) - toks[0].end);
|
||||
|
|
Loading…
Add table
Reference in a new issue