From 5be44312f80dd07b0a9ede1a175ac08f8cfdbd6a Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 19 Jul 2018 15:47:15 +0300 Subject: Removed redundand code --- ext/pcre/php_pcre.c | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'ext/pcre/php_pcre.c') diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 2f12fcf007..e438db3b89 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -1535,7 +1535,6 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *su uint32_t options; /* Execution options */ int count; /* Count of matched subpatterns */ PCRE2_SIZE *offsets; /* Array of subpattern offsets */ - char **subpat_names; /* Array for named subpatterns */ uint32_t num_subpats; /* Number of captured subpatterns */ size_t new_len; /* Length of needed storage */ size_t alloc_len; /* Actual allocated length */ @@ -1554,19 +1553,6 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *su /* Calculate the size of the offsets array, and allocate memory for it. */ num_subpats = pce->capture_count + 1; - - /* - * Build a mapping from subpattern numbers to their names. We will - * allocate the table only if there are any named subpatterns. - */ - subpat_names = NULL; - if (UNEXPECTED(pce->name_count > 0)) { - subpat_names = make_subpats_table(num_subpats, pce); - if (!subpat_names) { - return NULL; - } - } - alloc_len = 0; result = NULL; @@ -1582,9 +1568,6 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *su match_data = pcre2_match_data_create_from_pattern(pce->re, gctx); if (!match_data) { PCRE_G(error_code) = PHP_PCRE_INTERNAL_ERROR; - if (subpat_names) { - efree(subpat_names); - } return NULL; } } @@ -1785,10 +1768,6 @@ error: pcre2_match_data_free(match_data); } - if (UNEXPECTED(subpat_names)) { - efree(subpat_names); - } - return result; } /* }}} */ -- cgit v1.2.1