From 700ba55d26fcee081c4263ca7b5d80df1b88a70d Mon Sep 17 00:00:00 2001 From: dnc40085 Date: Thu, 7 May 2015 05:02:59 -0700 Subject: [PATCH] Fix for memory leak in function wifi.sta.getap() --- app/modules/wifi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/modules/wifi.c b/app/modules/wifi.c index 824638e6..03757017 100644 --- a/app/modules/wifi.c +++ b/app/modules/wifi.c @@ -86,6 +86,11 @@ static void wifi_scan_done(void *arg, STATUS status) lua_pushnil(gL); } lua_call(gL, 1, 0); + if(wifi_scan_succeed != LUA_NOREF) + { + luaL_unref(gL, LUA_REGISTRYINDEX, wifi_scan_succeed); + wifi_scan_succeed = LUA_NOREF; + } } // Lua: smart(channel, function succeed_cb)