mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-17 11:06:54 +00:00
BUG/MEDIUM: lua: Don't crash in hlua_lua2arg_check on failure
In hlua_lua2arg_check(), on failure, before calling free_argp(), make sure to always mark the failed argument as ARGT_STOP. We only want to free argument prior to that point, because we did not allocate the strings after this one, and so we don't want to free them. This should be backported up to 2.2.
This commit is contained in:
parent
d7755375a5
commit
ca43161a8d
@ -1101,6 +1101,7 @@ __LJMP int hlua_lua2arg_check(lua_State *L, int first, struct arg *argp,
|
||||
return 0;
|
||||
|
||||
error:
|
||||
argp[idx].type = ARGT_STOP;
|
||||
free_args(argp);
|
||||
WILL_LJMP(luaL_argerror(L, first + idx, msg));
|
||||
return 0; /* Never reached */
|
||||
|
Loading…
Reference in New Issue
Block a user