summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-10-29 09:04:55 +0100
committerJo-Philipp Wich <jo@mein.io>2020-05-26 16:18:26 +0200
commit16de3fa9fb9d83dbeac271b1ac38b74e698afa8d (patch)
treeb6def58b123eab55d5177b3ac7dfaf33ed402d35
parent29c9c11dfa4be5a34ee5f16913abf99e76f228fa (diff)
downloadrpcd-16de3fa9fb9d83dbeac271b1ac38b74e698afa8d.tar.gz
plugin: do not free method name separately
A previous commit changed the allocation method for the call context to include the method name string memory directly, so we must not treat the method member separately anymore. Fixes: 37aa919 ("plugin: fix leaking invoked method name for exec plugins") Signed-off-by: Jo-Philipp Wich <jo@mein.io> (cherry picked from commit ca3e2d5e70f188cc73a9bd1dadd3dcf2603bdba7)
-rw-r--r--plugin.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/plugin.c b/plugin.c
index bf7c74d..4f84994 100644
--- a/plugin.c
+++ b/plugin.c
@@ -146,7 +146,7 @@ rpc_plugin_call(struct ubus_context *ctx, struct ubus_object *obj,
c->input = blobmsg_format_json(msg, true);
c->tok = json_tokener_new();
- if (!c->method || !c->input || !c->tok)
+ if (!c->input || !c->tok)
goto fail;
plugin = c->path + sprintf(c->path, "%s/", RPC_PLUGIN_DIRECTORY);
@@ -171,9 +171,6 @@ rpc_plugin_call(struct ubus_context *ctx, struct ubus_object *obj,
fail:
if (c)
{
- if (c->method)
- free(c->method);
-
if (c->input)
free(c->input);