cvs: php-src /ext/date/lib tm2unixtime.c

From: Date: Wed, 15 Jun 2005 23:42:55 +0000
Subject: cvs: php-src /ext/date/lib tm2unixtime.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-32307@lists.php.net to get a copy of this message
iliaa Wed Jun 15 19:42:55 2005 EDT Modified files: /php-src/ext/date/lib tm2unixtime.c Log: Fixed memory leak. http://cvs.php.net/diff.php/php-src/ext/date/lib/tm2unixtime.c?r1=1.3&r2=1.4&ty=u Index: php-src/ext/date/lib/tm2unixtime.c diff -u php-src/ext/date/lib/tm2unixtime.c:1.3 php-src/ext/date/lib/tm2unixtime.c:1.4 --- php-src/ext/date/lib/tm2unixtime.c:1.3 Wed Jun 15 07:01:05 2005 +++ php-src/ext/date/lib/tm2unixtime.c Wed Jun 15 19:42:55 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: tm2unixtime.c,v 1.3 2005/06/15 11:01:05 derick Exp $ */ +/* $Id: tm2unixtime.c,v 1.4 2005/06/15 23:42:55 iliaa Exp $ */ #include "datetime.h" @@ -211,16 +211,21 @@ /* No timezone in struct, fallback to reference if possible */ if (tzi) { timelib_time_offset *before, *after; + timelib_sll tmp; tz->is_localtime = 1; before = timelib_get_time_zone_info(tz->sse, tzi); after = timelib_get_time_zone_info(tz->sse - before->offset, tzi); timelib_set_timezone(tz, tzi); if (before->is_dst != after->is_dst) { - return -tz->z + (before->offset - after->offset); + tmp = -tz->z + (before->offset - after->offset); } else { - return -tz->z; + tmp = -tz->z; } + timelib_time_offset_dtor(before); + timelib_time_offset_dtor(after); + + return tmp; } } return 0;

« previous php.cvs (#32307) next »