summaryrefslogtreecommitdiff
path: root/ext/pcre
diff options
context:
space:
mode:
authorAndrei Zmievski <andrei@php.net>2003-05-20 18:11:09 +0000
committerAndrei Zmievski <andrei@php.net>2003-05-20 18:11:09 +0000
commit8571f5eac2d24c4866d81ceb50830e00d3a5363a (patch)
tree15d832e4f15e3c3fa5b8ba200c613e384b3149f5 /ext/pcre
parent515f0e3f71677a5205487125dd64db9c52b71b43 (diff)
downloadphp-git-8571f5eac2d24c4866d81ceb50830e00d3a5363a.tar.gz
Put some guards in place.
Diffstat (limited to 'ext/pcre')
-rw-r--r--ext/pcre/php_pcre.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index f31a6bf207..7deb672a91 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -56,13 +56,15 @@ static void *php_pcre_malloc(size_t size)
static void php_pcre_free(void *ptr)
{
- pefree(ptr, 1);
+ if (ptr)
+ pefree(ptr, 1);
}
static void php_free_pcre_cache(void *data)
{
pcre_cache_entry *pce = (pcre_cache_entry *) data;
+ if (!pce) return;
pefree(pce->re, 1);
#if HAVE_SETLOCALE
if ((void*)pce->tables) pefree((void*)pce->tables, 1);