summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2019-07-04 13:07:47 +0300
committerDmitry Stogov <dmitry@zend.com>2019-07-04 13:07:47 +0300
commite3d35b64343e0619823bfa2fe104291a00ea7954 (patch)
treec3a8ba2654a8132262f41850bce3e16bc8f3b2ac /ext/pcre/php_pcre.c
parentdf243f19be8509f36c9a79a2f601bbaeb37762ae (diff)
downloadphp-git-e3d35b64343e0619823bfa2fe104291a00ea7954.tar.gz
Split destructor
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 66090f121a..cae276134c 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -143,7 +143,16 @@ static void php_free_pcre_cache(zval *data) /* {{{ */
pcre_cache_entry *pce = (pcre_cache_entry *) Z_PTR_P(data);
if (!pce) return;
pcre2_code_free(pce->re);
- pefree(pce, !PCRE_G(per_request_cache));
+ free(pce);
+}
+/* }}} */
+
+static void php_efree_pcre_cache(zval *data) /* {{{ */
+{
+ pcre_cache_entry *pce = (pcre_cache_entry *) Z_PTR_P(data);
+ if (!pce) return;
+ pcre2_code_free(pce->re);
+ efree(pce);
}
/* }}} */
@@ -459,7 +468,7 @@ static PHP_RINIT_FUNCTION(pcre)
#endif
if (PCRE_G(per_request_cache)) {
- zend_hash_init(&PCRE_G(pcre_cache), 0, NULL, php_free_pcre_cache, 0);
+ zend_hash_init(&PCRE_G(pcre_cache), 0, NULL, php_efree_pcre_cache, 0);
}
return SUCCESS;