Browse Source
plugin: Fix memory leak when requests are done
We weren't cleaning the requests we fulfilled, so this does that :-)
plugin-3
Christian Decker
6 years ago
No known key found for this signature in database
GPG Key ID: 1416D83DC4F0E86D
1 changed files with
3 additions and
0 deletions
-
lightningd/plugin.c
|
|
@ -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); |
|
|
|