Browse Source

plugin: Fix memory leak when requests are done

We weren't cleaning the requests we fulfilled, so this does that :-)
plugin-6
Christian Decker 6 years ago
committed by Rusty Russell
parent
commit
a4ded47d34
  1. 3
      lightningd/plugin.c

3
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);

Loading…
Cancel
Save