summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2019-07-04 13:08:08 +0300
committerDmitry Stogov <dmitry@zend.com>2019-07-04 13:08:08 +0300
commitf5869118a94391268ad1b297209ea35f66701c97 (patch)
tree31f21503fb8bebc76632e706860392ffc93d44b6 /ext
parent6473ec30a1627c7b98bfaf7de0e150fd4944eb9e (diff)
parente3d35b64343e0619823bfa2fe104291a00ea7954 (diff)
downloadphp-git-f5869118a94391268ad1b297209ea35f66701c97.tar.gz
Merge branch 'PHP-7.4'
* PHP-7.4: Split destructor
Diffstat (limited to 'ext')
-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;