From 24030d54d86e4b54055b9668d90e5680d8167094 Mon Sep 17 00:00:00 2001 From: Sara Golemon Date: Sun, 25 Jun 2017 19:37:36 -0400 Subject: [PATCH] Release temporary string reference --- ext/intl/dateformat/dateformat_create.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/intl/dateformat/dateformat_create.cpp b/ext/intl/dateformat/dateformat_create.cpp index e060711ce69..f08e0ed3f30 100644 --- a/ext/intl/dateformat/dateformat_create.cpp +++ b/ext/intl/dateformat/dateformat_create.cpp @@ -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);