summaryrefslogtreecommitdiff
path: root/user/nginx/fix-pcre2-reload-memory-leak.patch
blob: ee22872f1a9088c58a61ee6e1c438a858908cc77 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Source: https://trac.nginx.org/nginx/changeset/533bc2336df44679cc46e6fccf54675e13578f21/nginx

This patch was modified from upstream in the following way(s):

* Update path so that the patch applies correctly
* dos2unix

Index: src/core/ngx_regex.c
===================================================================
--- a/src/core/ngx_regex.c	(revision 8163)
+++ b/src/core/ngx_regex.c	(revision 9166)
@@ -601,4 +601,6 @@
      */
 
+    ngx_regex_malloc_init(NULL);
+
     if (ngx_regex_compile_context) {
         pcre2_compile_context_free(ngx_regex_compile_context);
@@ -611,4 +613,6 @@
         ngx_regex_match_data_size = 0;
     }
+
+    ngx_regex_malloc_done();
 
 #endif
@@ -707,7 +711,4 @@
 
     ngx_regex_studies = NULL;
-#if (NGX_PCRE2)
-    ngx_regex_compile_context = NULL;
-#endif
 
     return NGX_OK;