浏览代码

Merge pull request #162 from que273/master

app_lua: Fix memory leak in sr.modf
Hugh Waite 10 年之前
父节点
当前提交
4a480ba974
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      modules/app_lua/app_lua_sr.c

+ 5 - 0
modules/app_lua/app_lua_sr.c

@@ -265,6 +265,11 @@ static int lua_sr_modf (lua_State *L)
 		}
 	}
 	pkg_free(act);
+	for(i=0; i<MAX_ACTIONS; i++)
+	{
+		if(argv[i]!=NULL) pkg_free(argv[i]);
+		argv[i] = 0;
+	}
 	lua_pushinteger(L, ret);
 	return 1;