BUG/MINOR: hlua: add check for lua_newstate

Calling lual_newstate(Init main lua stack) in the hlua_init_state()
function, the return value of lua_newstate() may be NULL (for example
in case of OOM). In this case, L will be NULL, and then crash happens
in lua_getextraspace(). So, we add a check for lua_newstate.

This should be backported at least to 2.4, maybe further.

(cherry picked from commit bfff46f4112d978c0311ce57e0c90866994dac3e)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 64d7afb88b0a375d9d654649ee34aa9cdcd7112c)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 54378935a70b55d99c124034a7791b73a5525105)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 96ec59887311ef8c891ec6e72505458ca635d9e6)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed