On 06/21/2016 12:32 PM, Jo-Philipp Wich wrote: > Hi, > > first of all, thanks for putting work into that - I like the changes in > general. Have a few comments inline below. > > ~ Jo > [...] >> diff --git a/lua/uloop.c b/lua/uloop.c >> index 782b5a5..db89e72 100644 >> --- a/lua/uloop.c >> +++ b/lua/uloop.c >> @@ -325,9 +325,12 @@ static int ul_process(lua_State *L) >> int argn = lua_objlen(L, -3); >> int envn = lua_objlen(L, -2); >> char** argp = malloc(sizeof(char*) * (argn + 2)); >> - char** envp = malloc(sizeof(char*) * envn + 1); >> + char** envp = malloc(sizeof(char*) * (envn + 1)); >> int i = 1; >> >> + if (!argp || !envp) >> + exit(-1); > > A "return luaL_error(L, "Out of memory");" might be slightly more > appropriate here.
This one is actually in the forked process. I'll change it from exit() to _exit() to avoid affecting resources used by the parent process (and also adjust the exit() a few lines below). I don't think it would be appropriate to raise a Lua error in the child process. Matthias
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev