lua: Error if luaL_newstate returns NULL

This commit is contained in:
mniip 2016-04-04 04:28:02 +03:00 committed by Patrick Griffis
parent c4c1c64f00
commit 5699bf9e65

View File

@ -1306,6 +1306,7 @@ static script_info *create_script(char const *file)
info->state = L; info->state = L;
if(!L) if(!L)
{ {
hexchat_print(ph, "\00304Could not allocate memory for the script");
g_free(info->filename); g_free(info->filename);
free(info); free(info);
return NULL; return NULL;
@ -1493,6 +1494,7 @@ static void create_interpreter(void)
interp->state = L; interp->state = L;
if(!L) if(!L)
{ {
hexchat_print(ph, "\00304Could not allocate memory for the interpreter");
free(interp); free(interp);
interp = NULL; interp = NULL;
return; return;