From: Rui Guo Date: Wed, 17 Jun 2009 13:28:11 +0000 (+0800) Subject: Free allocated memory before luaL_error() in screen_input() X-Git-Url: https://repo.or.cz/w/screen-lua.git/commitdiff_plain/b9b11deef276474e33c4628e6cab3c5f71ba920f Free allocated memory before luaL_error() in screen_input() --- diff --git a/src/lua.c b/src/lua.c index f24420f..fb00b38 100644 --- a/src/lua.c +++ b/src/lua.c @@ -794,7 +794,10 @@ screen_input(lua_State *L) sidata = (struct sinput_data *)malloc(sizeof(struct sinput_data)); if (!sidata) - luaL_error(L, "Out of Memory"); + { + Free(lh); + luaL_error(L, "Out of Memory"); + } sidata->L = L; sidata->lh = lh;