From 8571f5eac2d24c4866d81ceb50830e00d3a5363a Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Tue, 20 May 2003 18:11:09 +0000 Subject: Put some guards in place. --- ext/pcre/php_pcre.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ext/pcre/php_pcre.c') 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); -- cgit v1.2.1