]> granicus.if.org Git - php/commitdiff
fix #33614 (memory leak in new strftime())
authorAntony Dovgal <tony2001@php.net>
Fri, 8 Jul 2005 10:23:33 +0000 (10:23 +0000)
committerAntony Dovgal <tony2001@php.net>
Fri, 8 Jul 2005 10:23:33 +0000 (10:23 +0000)
ext/date/php_date.c

index 689e05fc92a8002d83aeb2c27f0b37ffd463f200..b4652386b7133f7ef1c71755e4ff40d1645bc791 100644 (file)
@@ -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;