com php-src: Fixed refcounting: ext/pcre/php_pcre.c
| From: | Dmitry Stogov | Date: | Fri, 07 Mar 2014 13:17:35 +0000 |
| Subject: | com php-src: Fixed refcounting: ext/pcre/php_pcre.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77682@lists.php.net to get a copy of this message | ||
Commit: b671c3a28a6b72e2beb283cfc759c806d8d0bc01
Author: Dmitry Stogov <dmitry@zend.com> Fri, 7 Mar 2014 17:17:35 +0400
Parents: d599d0cecde196d2063d6b6b56d4ffebbaeab238
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b671c3a28a6b72e2beb283cfc759c806d8d0bc01
Log:
Fixed refcounting
Changed paths:
M ext/pcre/php_pcre.c
Diff:
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index e150760..8a5b069 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -1813,7 +1813,7 @@ PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval
*return
/* If the entry fits our requirements */
if ((count > 0 && !invert) || (count == PCRE_ERROR_NOMATCH && invert)) {
- Z_ADDREF_P(entry);
+ if (Z_REFCOUNTED_P(entry)) Z_ADDREF_P(entry);
/* Add to return array */
switch (zend_hash_get_current_key_ex(Z_ARRVAL_P(input), &string_key, &num_key, 0, NULL))