From: Andrei Zmievski Date: Tue, 20 May 2003 18:11:09 +0000 (+0000) Subject: Put some guards in place. X-Git-Tag: RELEASE_1_0_2~681 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8571f5eac2d24c4866d81ceb50830e00d3a5363a;p=php Put some guards in place. --- 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);