summaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-lua.c
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-12-10 15:09:35 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-12 17:44:42 +0100
commit4ddd78961076bbac5182666515cae980e3bebae1 (patch)
treef00f381973dfde629290a804f5a775b75534c2ed /ctl-lib/ctl-lua.c
parent76e47a2407062b38fed687e078cbc4e3598aa8a6 (diff)
memleak fixes
Change-Id: I575d87bf0770f24f2c7ddd6fba9b7917aad62c6d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-lua.c')
-rw-r--r--ctl-lib/ctl-lua.c3
1 files changed, 2 insertions, 1 deletions
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);