diff options
author | Anatol Belski <ab@php.net> | 2016-08-29 15:28:09 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2016-08-29 15:28:09 +0200 |
commit | 1d7ec685c1dedffb3ed7b3865bf9c07fcc7598e7 (patch) | |
tree | 97dabb2e758cebd5ab3f5f0537fb5cdc0a6bc6c0 | |
parent | eac7f4b6708ba1ff5bb2e76cc6d275419d50e589 (diff) | |
download | php-git-1d7ec685c1dedffb3ed7b3865bf9c07fcc7598e7.tar.gz |
fix possible memory leak
-rw-r--r-- | ext/pcre/php_pcre.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index fe6b7b3984..1ff8ae4654 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -1176,6 +1176,11 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *su if (UNEXPECTED(pce->name_count > 0)) { subpat_names = make_subpats_table(num_subpats, pce); if (!subpat_names) { + if (size_offsets <= 32) { + free_alloca(offsets, use_heap); + } else { + efree(offsets); + } return NULL; } } |