On Wed, Apr 26, 2017 at 02:41:18PM +0200, thierry.fourn...@arpalert.org wrote: > I catch the bug. It affect all the versions of HAProxy embedding Lua. > It is fixed. > > I join 2 main patches: > > - 0001*.patch: the bug fix, it should be backported > - 0002*.patch: a nice cleanup which is useless to backport
Thanks Thierry, but I can't merge these ones, look, one is broken with an unresolved conflict : > diff --git a/src/hlua.c b/src/hlua.c > index 4e35785..d276e3a 100644 > --- a/src/hlua.c > +++ b/src/hlua.c > @@ -3615,6 +3615,40 @@ static int hlua_applet_http_new(lua_State *L, struct > appctx *ctx) > return 1; > } > > +<<<<<<< HEAD > +======= > +__LJMP static int hlua_applet_http_set_priv(lua_State *L) > +{ > + struct hlua_appctx *appctx = MAY_LJMP(hlua_checkapplet_http(L, 1)); > + struct stream *s = appctx->htxn.s; > + struct hlua *hlua = &s->hlua; > + > + MAY_LJMP(check_args(L, 2, "set_priv")); > + > + /* Remove previous value. */ > + if (hlua->Mref != -1) > + luaL_unref(L, LUA_REGISTRYINDEX, hlua->Mref); > + > + /* Get and store new value. */ > + lua_pushvalue(L, 2); /* Copy the element 2 at the top of the stack. */ > + hlua->Mref = luaL_ref(L, LUA_REGISTRYINDEX); /* pop the previously > pushed value. */ > + > + return 0; > +} > + > +__LJMP static int hlua_applet_http_get_priv(lua_State *L) > +{ > + struct hlua_appctx *appctx = MAY_LJMP(hlua_checkapplet_http(L, 1)); > + struct stream *s = appctx->htxn.s; > + struct hlua *hlua = &s->hlua; > + > + /* Push configuration index in the stack. */ > + lua_rawgeti(L, LUA_REGISTRYINDEX, hlua->Mref); > + > + return 1; > +} > + > +>>>>>>> c43224e... BUG/MEDIUM: lua: memory leak Also I think that this function is not used anywhere else in the patch, so please confirm. Thanks, Willy