diff options
author | Andrei Zmievski <andrei@php.net> | 2003-05-20 18:11:09 +0000 |
---|---|---|
committer | Andrei Zmievski <andrei@php.net> | 2003-05-20 18:11:09 +0000 |
commit | 8571f5eac2d24c4866d81ceb50830e00d3a5363a (patch) | |
tree | 15d832e4f15e3c3fa5b8ba200c613e384b3149f5 /ext/pcre | |
parent | 515f0e3f71677a5205487125dd64db9c52b71b43 (diff) | |
download | php-git-8571f5eac2d24c4866d81ceb50830e00d3a5363a.tar.gz |
Put some guards in place.
Diffstat (limited to 'ext/pcre')
-rw-r--r-- | ext/pcre/php_pcre.c | 4 |
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); |