]> granicus.if.org Git - php/commitdiff
Release temporary string reference
authorSara Golemon <pollita@php.net>
Sun, 25 Jun 2017 23:37:36 +0000 (19:37 -0400)
committerSara Golemon <pollita@php.net>
Sun, 25 Jun 2017 23:39:13 +0000 (19:39 -0400)
ext/intl/dateformat/dateformat_create.cpp

index e060711ce6950ef47d23783ff573d2c7d6cc8965..f08e0ed3f30aa74c8c26771295813d0826c2c36d 100644 (file)
@@ -216,7 +216,9 @@ U_CFUNC PHP_METHOD( IntlDateFormatter, __construct )
        return_value = getThis();
        if (datefmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1) == FAILURE) {
                if (!EG(exception)) {
-                       zend_throw_exception(IntlException_ce_ptr, ZSTR_VAL(intl_error_get_message(NULL)), intl_error_get_code(NULL));
+                       zend_string *err = intl_error_get_message(NULL);
+                       zend_throw_exception(IntlException_ce_ptr, ZSTR_VAL(err), intl_error_get_code(NULL));
+                       zend_string_release(err);
                }
        }
        zend_restore_error_handling(&error_handling);