Skip to content

Commit f40e371

Browse files
committed
Revert "refactor: we no longer call ngx_pfree() in our own pcre_free hook."
This reverts commit 5c788b8.
1 parent fcbbf52 commit f40e371

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/ngx_http_lua_pcrefix.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,16 @@ ngx_http_lua_pcre_malloc(size_t size)
4242

4343

4444
static void
45-
ngx_http_lua_pcre_free(void *p)
45+
ngx_http_lua_pcre_free(void *ptr)
4646
{
47-
return;
47+
dd("lua pcre pool is %p", ngx_http_lua_pcre_pool);
48+
49+
if (ngx_http_lua_pcre_pool) {
50+
ngx_pfree(ngx_http_lua_pcre_pool, ptr);
51+
return;
52+
}
53+
54+
fprintf(stderr, "error: lua pcre free failed due to empty pcre pool");
4855
}
4956

5057

0 commit comments

Comments
 (0)