diff options
author | Antony Dovgal <tony2001@php.net> | 2006-03-18 23:43:48 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2006-03-18 23:43:48 +0000 |
commit | 91f4b380d6f30e6f5102a470e7a6844ff5deaa37 (patch) | |
tree | 22046b7b418aa548119999090cb21f61231b42d0 /ext/date | |
parent | 5c7c11c41de609427cd3f1d4d9807e7d80a9075e (diff) | |
download | php-git-91f4b380d6f30e6f5102a470e7a6844ff5deaa37.tar.gz |
fix several leaks in date_sun*() functions
Diffstat (limited to 'ext/date')
-rw-r--r-- | ext/date/lib/parse_tz.c | 5 | ||||
-rw-r--r-- | ext/date/php_date.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c index 737181da5c..aa8aebd46b 100644 --- a/ext/date/lib/parse_tz.c +++ b/ext/date/lib/parse_tz.c @@ -368,6 +368,7 @@ timelib_time_offset *timelib_get_time_zone_info(timelib_sll ts, timelib_tzinfo * timelib_sll timelib_get_current_offset(timelib_time *t) { timelib_time_offset *gmt_offset; + timelib_sll retval; switch (t->zone_type) { case TIMELIB_ZONETYPE_ABBR: @@ -376,7 +377,9 @@ timelib_sll timelib_get_current_offset(timelib_time *t) case TIMELIB_ZONETYPE_ID: gmt_offset = timelib_get_time_zone_info(t->sse, t->tz_info); - return gmt_offset->offset; + retval = gmt_offset->offset; + timelib_time_offset_dtor(gmt_offset); + return retval; default: return 0; diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 758c019106..5c5dd59218 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1746,7 +1746,8 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su timelib_unixtime2local(t, time); rs = timelib_astro_rise_set_altitude(t, longitude, latitude, altitude, altitude > -1 ? 1 : 0, &h_rise, &h_set, &rise, &set, &transit); - + timelib_time_dtor(t); + if (rs != 0) { RETURN_FALSE; } @@ -1889,6 +1890,8 @@ PHP_FUNCTION(date_sun_info) t2->sse = set; add_assoc_long(return_value, "astronomical_twilight_end", timelib_date_to_int(t2, &dummy)); } + timelib_time_dtor(t); + timelib_time_dtor(t2); } /* }}} */ /* |