From db14b8549e7bb9c132435f845a16f8d33677e865 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sat, 8 May 2021 16:28:14 +0200 Subject: [PATCH] Fix a memory leak when using pcre2 --- src/sp_pcre_compat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sp_pcre_compat.c b/src/sp_pcre_compat.c index 0d19769e..09a2fc72 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, sp_log_err("regexp", "Unable to get memory for a regxp."); } ret = pcre2_match(regexp, (PCRE2_SPTR)str, len, 0, 0, match_data, NULL); + pcre2_match_data_free(match_data); #else int vec[30]; ret = pcre_exec(regexp, NULL, str, len, 0, 0, vec, sizeof(vec) / sizeof(int));