Closed daurnimator closed 8 years ago
Right. I moved the check for the connection object to the top of these functions (although the memory would not leak anymore due to the use of lua_newuserdata(). Thanks!
This matters for more than just the connection object.
You should also move up the other argument checking (like luaL_checkstring
).
You should also move up the other argument checking (like luaL_checkstring).
This was fixed in 252104788ee25610cad77abdd87ca4538865b54e
e.g. in conn_sendQueryParams
If the first argument is not a pgsql connection, then it will throw at line 821. However at this point
paramTypes
,paramValues
, etc have already been allocated.Fix is to move those arguments check to the start of the function.
Same issue is in other places, including
conn_execParams
,conn_prepare
,conn_execPrepared
,conn_sendPrepare
,conn_sendQueryPrepared
,