executor: Fix some memory leaks

This commit is contained in:
ZyX
2017-01-29 19:32:01 +03:00
parent e1bbaca7ac
commit 295e7607c4
3 changed files with 21 additions and 1 deletions

View File

@@ -182,8 +182,14 @@ static int nlua_exec_luado_string(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL
if (luaL_loadbuffer(lstate, lcmd, lcmd_len, NLUA_EVAL_NAME)) {
nlua_error(lstate, _("E5109: Error while creating lua chunk: %.*s"));
if (lcmd_len >= IOSIZE) {
xfree(lcmd);
}
return 0;
}
if (lcmd_len >= IOSIZE) {
xfree(lcmd);
}
if (lua_pcall(lstate, 0, 1, 0)) {
nlua_error(lstate, _("E5110: Error while creating lua function: %.*s"));
return 0;