Skip to content

Commit 53f8369

Browse files
committed
ext/pcre: preg_match() fix memory leak with invalid regexes.
1 parent ec5a1e0 commit 53f8369

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

ext/pcre/php_pcre.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1489,7 +1489,8 @@ ZEND_FRAMELESS_FUNCTION(preg_match, 2)
14891489
/* Compile regex or get it from cache. */
14901490
pcre_cache_entry *pce;
14911491
if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) {
1492-
RETURN_FALSE;
1492+
RETVAL_FALSE;
1493+
goto flf_clean;
14931494
}
14941495

14951496
pce->refcount++;

0 commit comments

Comments
 (0)