# HG changeset patch # User jbe # Date 1452622204 -3600 # Node ID e64ef2b681d28e4a7bae2ae68af7c65fb2673b5d # Parent 837690e70cae43acbeb27ba05b3f7221f669963a Bugfix regarding emergency memory cleanup (missing memory initialization) diff -r 837690e70cae -r e64ef2b681d2 libraries/mondelefant/mondelefant_native.c --- a/libraries/mondelefant/mondelefant_native.c Tue Jan 12 19:04:46 2016 +0100 +++ b/libraries/mondelefant/mondelefant_native.c Tue Jan 12 19:10:04 2016 +0100 @@ -256,9 +256,9 @@ } // use conninfo string on stack position 1: conninfo = lua_tostring(L, 1); - // create userdata on stack position 2: + // create (zero'ed) userdata on stack position 2: lua_settop(L, 1); - conn = lua_newuserdata(L, sizeof(*conn)); // 2 + conn = memset(lua_newuserdata(L, sizeof(*conn)), 0, sizeof(*conn)); // 2 // call PQconnectdb function of libpq: conn->pgconn = PQconnectdb(conninfo); // try emergency garbage collection on first failure: