diff options
| author | jvoisin | 2021-05-08 16:28:14 +0200 |
|---|---|---|
| committer | jvoisin | 2021-05-08 16:28:14 +0200 |
| commit | db14b8549e7bb9c132435f845a16f8d33677e865 (patch) | |
| tree | 29737fae793ad9a408aa8ef0dc65ac9fb04c5bd0 /src | |
| parent | 916a9d755a1660e086ef66d7113c2bcfc808a557 (diff) | |
Fix a memory leak when using pcre2
Diffstat (limited to 'src')
| -rw-r--r-- | src/sp_pcre_compat.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/sp_pcre_compat.c b/src/sp_pcre_compat.c index 0d19769..09a2fc7 100644 --- a/src/sp_pcre_compat.c +++ b/src/sp_pcre_compat.c | |||
| @@ -38,6 +38,7 @@ bool ZEND_HOT sp_is_regexp_matching_len(const sp_pcre* regexp, const char* str, | |||
| 38 | sp_log_err("regexp", "Unable to get memory for a regxp."); | 38 | sp_log_err("regexp", "Unable to get memory for a regxp."); |
| 39 | } | 39 | } |
| 40 | ret = pcre2_match(regexp, (PCRE2_SPTR)str, len, 0, 0, match_data, NULL); | 40 | ret = pcre2_match(regexp, (PCRE2_SPTR)str, len, 0, 0, match_data, NULL); |
| 41 | pcre2_match_data_free(match_data); | ||
| 41 | #else | 42 | #else |
| 42 | int vec[30]; | 43 | int vec[30]; |
| 43 | ret = pcre_exec(regexp, NULL, str, len, 0, 0, vec, sizeof(vec) / sizeof(int)); | 44 | ret = pcre_exec(regexp, NULL, str, len, 0, 0, vec, sizeof(vec) / sizeof(int)); |
