derick          Wed Oct 12 15:49:59 2005 EDT

  Modified files:              (Branch: PHP_5_1)
    /php-src/ext/date   php_date.c 
  Log:
  - 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.
  
  
http://cvs.php.net/diff.php/php-src/ext/date/php_date.c?r1=1.43.2.15&r2=1.43.2.16&ty=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.43.2.15 
php-src/ext/date/php_date.c:1.43.2.16
--- php-src/ext/date/php_date.c:1.43.2.15       Mon Oct 10 12:42:32 2005
+++ php-src/ext/date/php_date.c Wed Oct 12 15:49:59 2005
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_date.c,v 1.43.2.15 2005/10/10 16:42:32 derick Exp $ */
+/* $Id: php_date.c,v 1.43.2.16 2005/10/12 19:49:59 derick Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -190,9 +190,7 @@
 {
        timelib_tzinfo **tzi = (timelib_tzinfo **)tzinfo;
 
-       if (*tzi) {
-               timelib_tzinfo_dtor(*tzi);
-       }
+       timelib_tzinfo_dtor(*tzi);
 }
 
 /* {{{ PHP_RINIT_FUNCTION */
@@ -289,7 +287,9 @@
        }
 
        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;
 }
 /* }}} */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to