diff options
| author | Derick Rethans <derick@php.net> | 2005-10-12 19:49:59 +0000 |
|---|---|---|
| committer | Derick Rethans <derick@php.net> | 2005-10-12 19:49:59 +0000 |
| commit | cd90395cb6ccbf381dc293d195fbb4616c907bd0 (patch) | |
| tree | 1ff380c3f212d22dce8898e15a154b809d22a778 | |
| parent | 49678f0908f8b7cdfca72f3e1bfd6b7af769186f (diff) | |
| download | php-git-cd90395cb6ccbf381dc293d195fbb4616c907bd0.tar.gz | |
- MFH: Apperently you can't store NULL pointer values into Zend hashes - god
know why not - so we won't store those in the cache anymore.
| -rw-r--r-- | ext/date/php_date.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 1d8214b125..73648d2d5e 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -190,9 +190,7 @@ static void _php_date_tzinfo_dtor(void *tzinfo) { timelib_tzinfo **tzi = (timelib_tzinfo **)tzinfo; - if (*tzi) { - timelib_tzinfo_dtor(*tzi); - } + timelib_tzinfo_dtor(*tzi); } /* {{{ PHP_RINIT_FUNCTION */ @@ -289,7 +287,9 @@ static timelib_tzinfo *php_date_parse_tzfile(char *formal_tzname, timelib_tzdb * } tzi = timelib_parse_tzfile(formal_tzname, tzdb); - zend_hash_add(&DATEG(tzcache), formal_tzname, strlen(formal_tzname) + 1, (void *) &tzi, sizeof(timelib_tzinfo*), NULL); + if (tzi) { + zend_hash_add(&DATEG(tzcache), formal_tzname, strlen(formal_tzname) + 1, (void *) &tzi, sizeof(timelib_tzinfo*), NULL); + } return tzi; } /* }}} */ |
