summaryrefslogtreecommitdiff
path: root/src/reqpool.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2021-11-22 19:46:05 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2021-11-22 22:33:05 -0500
commitc378e3ad8ca6a31b0760f127bb31cad25b8b98dd (patch)
tree4050314e24e43ac7a788869bcc625527d221e3b1 /src/reqpool.c
parent670b3a395ff6365bc92889d5aafd72e362dc97c2 (diff)
downloadlighttpd-git-c378e3ad8ca6a31b0760f127bb31cad25b8b98dd.tar.gz
[core] allocate pcre output vector on demand
allocate pcre output vector on demand for saved config captures (similar to what is done in lighttpd for pcre2 support)
Diffstat (limited to 'src/reqpool.c')
-rw-r--r--src/reqpool.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/reqpool.c b/src/reqpool.c
index 9ffc1ddd..aca37a4d 100644
--- a/src/reqpool.c
+++ b/src/reqpool.c
@@ -232,12 +232,15 @@ request_free_data (request_st * const r)
free(r->cond_cache);
#ifdef HAVE_PCRE
if (r->cond_match_data) {
- #ifdef HAVE_PCRE2_H
for (int i = 0, used = r->con->srv->config_captures; i < used; ++i) {
+ #ifdef HAVE_PCRE2_H
if (r->cond_match_data[i].match_data)
pcre2_match_data_free(r->cond_match_data[i].match_data);
+ #else /* HAVE_PCRE_H */
+ if (r->cond_match_data[i].matches)
+ free(r->cond_match_data[i].matches);
+ #endif
}
- #endif
free(r->cond_match_data);
free(r->cond_match);
}