diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2005-06-15 23:42:55 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2005-06-15 23:42:55 +0000 |
commit | 73d503471c77dde174bcbd4f50c632fa200cdf7a (patch) | |
tree | 5971cf98394c60795d5b282233af938325b0d356 /ext/date/lib/tm2unixtime.c | |
parent | 694585e1a8ddfbea74e8efa18408b20cb584e75c (diff) | |
download | php-git-73d503471c77dde174bcbd4f50c632fa200cdf7a.tar.gz |
Fixed memory leak.
Diffstat (limited to 'ext/date/lib/tm2unixtime.c')
-rw-r--r-- | ext/date/lib/tm2unixtime.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/date/lib/tm2unixtime.c b/ext/date/lib/tm2unixtime.c index a62dbb8a34..9a56e8b3f2 100644 --- a/ext/date/lib/tm2unixtime.c +++ b/ext/date/lib/tm2unixtime.c @@ -211,16 +211,21 @@ static timelib_sll do_adjust_timezone(timelib_time *tz, timelib_tzinfo *tzi) /* 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; |