aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/lua-lpeg/lptree.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/lua-lpeg/lptree.c')
-rw-r--r--contrib/lua-lpeg/lptree.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/contrib/lua-lpeg/lptree.c b/contrib/lua-lpeg/lptree.c
index 7a91931bf..cb8342459 100644
--- a/contrib/lua-lpeg/lptree.c
+++ b/contrib/lua-lpeg/lptree.c
@@ -358,6 +358,7 @@ static TTree *gettree (lua_State *L, int idx, int *len) {
static TTree *newtree (lua_State *L, int len) {
size_t size = (len - 1) * sizeof(TTree) + sizeof(Pattern);
Pattern *p = (Pattern *)lua_newuserdata(L, size);
+ memset(p, 0, size);
luaL_getmetatable(L, PATTERN_T);
lua_pushvalue(L, -1);
lua_setuservalue(L, -3);