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>
This commit is contained in:
Jo-Philipp Wich 2019-10-29 09:04:55 +01:00
parent 02c6e1d08c
commit ca3e2d5e70

View file

@ -146,7 +146,7 @@ rpc_plugin_call(struct ubus_context *ctx, struct ubus_object *obj,
c->input = blobmsg_format_json(msg, true); c->input = blobmsg_format_json(msg, true);
c->tok = json_tokener_new(); c->tok = json_tokener_new();
if (!c->method || !c->input || !c->tok) if (!c->input || !c->tok)
goto fail; goto fail;
plugin = c->path + sprintf(c->path, "%s/", RPC_PLUGIN_DIRECTORY); 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: fail:
if (c) if (c)
{ {
if (c->method)
free(c->method);
if (c->input) if (c->input)
free(c->input); free(c->input);