Skip to content

Commit 86cf76e

Browse files
bugfix: did't free ngx_regex_match_context.
1 parent 7e8fbcf commit 86cf76e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ngx_stream_lua_regex.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,11 @@ ngx_stream_lua_regex_cleanup(void *data)
511511

512512
if (ngx_regex_compile_context) {
513513
old_pool = ngx_stream_lua_pcre_malloc_init(NULL);
514+
if (ngx_regex_match_context != NULL) {
515+
pcre2_match_context_free(ngx_regex_match_context);
516+
ngx_regex_match_context = NULL;
517+
}
518+
514519
pcre2_compile_context_free(ngx_regex_compile_context);
515520
ngx_regex_compile_context = NULL;
516521
ngx_stream_lua_pcre_malloc_done(old_pool);

0 commit comments

Comments
 (0)