BUG/MINOR: hlua: missing lock in hlua_filter_new()

This is a complementary patch to 8670db7 ("BUG/MAJOR: hlua: improper lock
usage with hlua_ctx_resume()") for hlua_filter_new().

Indeed, the HLUA_E_ERRMSG case still relies on the lua stack but didn't
take the lock to do so.

This should be backported up to 2.6.
This commit is contained in:
Aurelien DARRAGON 2024-03-11 13:50:41 +01:00
parent 4aefffc38c
commit ecd8f3bfd7

View File

@ -11989,7 +11989,9 @@ static int hlua_filter_new(struct stream *s, struct filter *filter)
filter->ctx = flt_ctx;
break;
case HLUA_E_ERRMSG:
hlua_lock(s->hlua);
SEND_ERR(s->be, "Lua filter '%s' : %s.\n", conf->reg->name, hlua_tostring_safe(s->hlua->T, -1));
hlua_unlock(s->hlua);
ret = -1;
goto end;
case HLUA_E_ETMOUT: