From: Ilia Alshanetsky Date: Thu, 30 Jun 2005 22:44:28 +0000 (+0000) Subject: Fixed memory leak on error inside php_date(). X-Git-Tag: php-5.1.0b3~240 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7575ef47782fcef4d946cf1c69d63dfa6f926d70;p=php Fixed memory leak on error inside php_date(). --- diff --git a/ext/date/php_date.c b/ext/date/php_date.c index aa1d77d1fa..64ecefce30 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -249,15 +249,16 @@ static void php_date(INTERNAL_FUNCTION_PARAMETERS, int localtime) RETURN_FALSE; } - t = timelib_time_ctor(); + t = timelib_time_ctor(); if (localtime) { tzi = timelib_parse_tzfile(guess_timezone()); if (! tzi) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot find any timezone setting"); + timelib_time_dtor(t); RETURN_FALSE; } - timelib_unixtime2local(t, ts, tzi); + timelib_unixtime2local(t, ts, tzi); } else { tzi = NULL; timelib_unixtime2gmt(t, ts);