diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-12-21 12:48:49 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-12-21 12:48:49 +0100 |
commit | a29be5cf022681c99214c50bd167f6cc85f75831 (patch) | |
tree | 4c991022e0ee2ed3cf2eef67343aa86912c0ab51 /ctl-lib/ctl-lua.c | |
parent | 958e2d98e37907e565a0cdd12459c5ae4b11887e (diff) |
Fix memory leakeel_5.1.0eel_5.0.3eel_5.0.2eel_5.0.1eel_5.0.0eel_4.99.5eel/5.1.0eel/5.0.3eel/5.0.2eel/5.0.1eel/5.0.0eel/4.99.55.1.05.0.35.0.25.0.15.0.04.99.5eel
Change-Id: I5ba04ecfb7809f9132e7958c5044b3d821830e8a
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-lua.c')
-rw-r--r-- | ctl-lib/ctl-lua.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ctl-lib/ctl-lua.c b/ctl-lib/ctl-lua.c index 33b797b..891e857 100644 --- a/ctl-lib/ctl-lua.c +++ b/ctl-lib/ctl-lua.c @@ -351,9 +351,11 @@ STATIC int LuaFormatMessage(lua_State* luaState, int verbosity, int level) { PrintMessage: // TBD: __file__ and __line__ should match LUA source code AFB_ApiVerbose(source->api, level,__FILE__,__LINE__,source->uid, "%s", message); + json_object_put(responseJ); return 0; // nothing return to lua OnErrorExit: // on argument to return (the error message) + json_object_put(responseJ); return 1; } @@ -393,6 +395,7 @@ STATIC int LuaAfbSuccess(lua_State* luaState) { AFB_ReqSucess (source->request, responseJ, NULL); + json_object_put(responseJ); return 0; OnErrorExit: @@ -409,6 +412,7 @@ STATIC int LuaAfbFail(lua_State* luaState) { AFB_ReqFail(source->request, source->uid, json_object_get_string(responseJ)); + json_object_put(responseJ); return 0; OnErrorExit: |