openresty / meta-lua-nginx-module

Meta Lua Nginx Module supporting both Http Lua Module and Stream Lua Module
66 stars 20 forks source link

bugfix: memory leak in debug log function #85

Closed hawkxiang closed 3 years ago

hawkxiang commented 3 years ago

If turn on nginx debug log ./configure --with-debug ..., but not select debug_http log level. ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ...) will be ignored, malloc_trim() can't be executed as function parameter. And memory isn't returned to OS immediately. This bug may cause serious memory leak, OOM. 截屏2020-12-03 下午5 52 27 Simply, ngx_log_debug1 is optional, but malloc_trim obligatory.