summaryrefslogtreecommitdiffstats
path: root/ctl-lib
diff options
context:
space:
mode:
Diffstat (limited to 'ctl-lib')
-rw-r--r--ctl-lib/ctl-event.c4
-rw-r--r--ctl-lib/ctl-lua.c3
2 files changed, 4 insertions, 3 deletions
diff --git a/ctl-lib/ctl-event.c b/ctl-lib/ctl-event.c
index 1bed333..d17bd3c 100644
--- a/ctl-lib/ctl-event.c
+++ b/ctl-lib/ctl-event.c
@@ -57,7 +57,7 @@ void CtrlDispatchApiEvent (AFB_ApiT apiHandle, const char *evtLabel, struct json
source.request = NULL;
// Best effort ignoring error to exec corresponding action
- (void) ActionExecOne (&source, &actions[idx], json_object_get(eventJ));
+ (void) ActionExecOne (&source, &actions[idx], eventJ);
}
#else
@@ -80,7 +80,7 @@ void CtrlDispatchV2Event(const char *evtLabel, json_object *eventJ) {
source.request = AFB_ReqNone;
// Best effort ignoring error to exec corresponding action
- (void) ActionExecOne (&source, &actions[index], json_object_get(eventJ));
+ (void) ActionExecOne (&source, &actions[index], eventJ);
}
#endif
diff --git a/ctl-lib/ctl-lua.c b/ctl-lib/ctl-lua.c
index 696a5de..4a32f26 100644
--- a/ctl-lib/ctl-lua.c
+++ b/ctl-lib/ctl-lua.c
@@ -521,6 +521,7 @@ static int LuaAfbServiceSync(lua_State* luaState) {
lua_pushboolean(luaState, iserror);
count += LuaPushArgument(source, responseJ);
+ json_object_put(responseJ);
return count; // return count values
}
@@ -638,7 +639,7 @@ static int LuaAfbEventMake(lua_State* luaState) {
}
// event name should be the only argument
- afbevt->name = strdup(lua_tostring(luaState, LUA_FIRST_ARG + 1));
+ afbevt->name = strdupa(lua_tostring(luaState, LUA_FIRST_ARG + 1));
// create a new binder event
afbevt->event = AFB_EventMake(source->api, afbevt->name);