From 0cde7b0683bf3f9550ad97bfdbedc22511c1505c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 27 Sep 2019 15:05:16 +0100 Subject: [Minor] Init tree before usage --- contrib/lua-lpeg/lptree.c | 1 + 1 file changed, 1 insertion(+) (limited to 'contrib') 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); -- cgit v1.2.3