From: Antony Dovgal Date: Fri, 8 Jul 2005 10:23:33 +0000 (+0000) Subject: fix #33614 (memory leak in new strftime()) X-Git-Tag: php-5.1.0b3~100 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d705522bbed6ee9360c104d9a9443627877660c7;p=php fix #33614 (memory leak in new strftime()) --- diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 689e05fc92..b4652386b7 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -645,6 +645,10 @@ PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gmt) #endif } + if (!gmt) { + timelib_tzinfo_dtor(tzi); + } + buf = (char *) emalloc(buf_len); while ((real_len=strftime(buf, buf_len, format, &ta))==buf_len || real_len==0) { buf_len *= 2;