From a4ded47d34624ee6e9d8b44059471031601a647d Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 26 Nov 2018 22:08:24 +0100 Subject: [PATCH] plugin: Fix memory leak when requests are done We weren't cleaning the requests we fulfilled, so this does that :-) --- lightningd/plugin.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lightningd/plugin.c b/lightningd/plugin.c index 5b1e336f7..ea3af5277 100644 --- a/lightningd/plugin.c +++ b/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);