webmcp

changeset 423:e64ef2b681d2

Bugfix regarding emergency memory cleanup (missing memory initialization)
author jbe
date Tue Jan 12 19:10:04 2016 +0100 (2016-01-12)
parents 837690e70cae
children 553a1a9dbc4c
files libraries/mondelefant/mondelefant_native.c
line diff
     1.1 --- a/libraries/mondelefant/mondelefant_native.c	Tue Jan 12 19:04:46 2016 +0100
     1.2 +++ b/libraries/mondelefant/mondelefant_native.c	Tue Jan 12 19:10:04 2016 +0100
     1.3 @@ -256,9 +256,9 @@
     1.4    }
     1.5    // use conninfo string on stack position 1:
     1.6    conninfo = lua_tostring(L, 1);
     1.7 -  // create userdata on stack position 2:
     1.8 +  // create (zero'ed) userdata on stack position 2:
     1.9    lua_settop(L, 1);
    1.10 -  conn = lua_newuserdata(L, sizeof(*conn));  // 2
    1.11 +  conn = memset(lua_newuserdata(L, sizeof(*conn)), 0, sizeof(*conn));  // 2
    1.12    // call PQconnectdb function of libpq:
    1.13    conn->pgconn = PQconnectdb(conninfo);
    1.14    // try emergency garbage collection on first failure:

Impressum / About Us