summaryrefslogtreecommitdiff
path: root/ext/intl/formatter
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-07-05 10:57:49 +0300
committerDmitry Stogov <dmitry@zend.com>2018-07-05 10:57:49 +0300
commit265c3ed6cfd05b78fb65187f18b3e1ecb560c242 (patch)
tree55601eaa8fa113bba16538ef475420c38f92e3b1 /ext/intl/formatter
parent587ab006984dae0ecee2c8eb41f08d3da155d7ef (diff)
downloadphp-git-265c3ed6cfd05b78fb65187f18b3e1ecb560c242.tar.gz
Fixed incorrrecr zval_dtor() usage to replace value of argument passed by reference, that may lead to memory leaks.
Diffstat (limited to 'ext/intl/formatter')
-rw-r--r--ext/intl/formatter/formatter_parse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/intl/formatter/formatter_parse.c b/ext/intl/formatter/formatter_parse.c
index 73909f5b9a..347f929cbd 100644
--- a/ext/intl/formatter/formatter_parse.c
+++ b/ext/intl/formatter/formatter_parse.c
@@ -106,7 +106,7 @@ PHP_FUNCTION( numfmt_parse )
efree(oldlocale);
#endif
if(zposition) {
- zval_dtor(zposition);
+ zval_ptr_dtor(zposition);
ZVAL_LONG(zposition, position);
}
@@ -162,7 +162,7 @@ PHP_FUNCTION( numfmt_parse_currency )
number = unum_parseDoubleCurrency(FORMATTER_OBJECT(nfo), sstr, sstr_len, position_p, currency, &INTL_DATA_ERROR_CODE(nfo));
if(zposition) {
- zval_dtor(zposition);
+ zval_ptr_dtor(zposition);
ZVAL_LONG(zposition, position);
}
if (sstr) {
@@ -173,7 +173,7 @@ PHP_FUNCTION( numfmt_parse_currency )
/* Convert parsed currency to UTF-8 and pass it back to caller. */
u8str = intl_convert_utf16_to_utf8(currency, u_strlen(currency), &INTL_DATA_ERROR_CODE(nfo));
INTL_METHOD_CHECK_STATUS( nfo, "Currency conversion to UTF-8 failed" );
- zval_dtor( zcurrency );
+ zval_ptr_dtor( zcurrency );
ZVAL_NEW_STR(zcurrency, u8str);
RETVAL_DOUBLE( number );