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
1 changed files with 2 additions and 0 deletions

View File

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