]> granicus.if.org Git - php/commitdiff
Fix leak in IntlCalendar::fromDateTime()
authorNikita Popov <nikic@php.net>
Thu, 16 Apr 2015 19:43:19 +0000 (21:43 +0200)
committerNikita Popov <nikic@php.net>
Fri, 17 Apr 2015 07:28:36 +0000 (09:28 +0200)
ext/intl/calendar/calendar_methods.cpp

index c8acf5fe54602a9bf1a2380aae3cdde882e8e4a7..ac5b33a89c21c9e68d3dcf0b798c3b538667b4b6 100644 (file)
@@ -1161,11 +1161,11 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
                        Z_OBJCE_P(zv_arg), php_date_get_date_ce()))) {
                object_init_ex(&zv_tmp, php_date_get_date_ce());
                zend_call_method_with_1_params(&zv_tmp, NULL, NULL, "__construct", NULL, zv_arg);
+               zv_datetime = &zv_tmp;
                if (EG(exception)) {
                        zend_object_store_ctor_failed(Z_OBJ(zv_tmp));
                        goto error;
                }
-               zv_datetime = &zv_tmp;
        } else {
                zv_datetime = zv_arg;
        }