]> granicus.if.org Git - php/commitdiff
Fixed memory leak on error inside php_date().
authorIlia Alshanetsky <iliaa@php.net>
Thu, 30 Jun 2005 22:44:28 +0000 (22:44 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 30 Jun 2005 22:44:28 +0000 (22:44 +0000)
ext/date/php_date.c

index aa1d77d1facb34f3b3eaa0d0bc5b379b9f2efb84..64ecefce304916614ef1217b5f92c1310b60bf0c 100644 (file)
@@ -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);