diff options
Diffstat (limited to 'ext/xml/xml.c')
-rw-r--r-- | ext/xml/xml.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/ext/xml/xml.c b/ext/xml/xml.c index b832732f0d..fe29f2891d 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -63,7 +63,7 @@ ZEND_DECLARE_MODULE_GLOBALS(xml) /* {{{ dynamically loadable module stuff */ #ifdef COMPILE_DL_XML #ifdef ZTS -ZEND_TSRMLS_CACHE_DEFINE(); +ZEND_TSRMLS_CACHE_DEFINE() #endif ZEND_GET_MODULE(xml) #endif /* COMPILE_DL_XML */ @@ -483,9 +483,7 @@ static void xml_call_handler(xml_parser *parser, zval *handler, zend_function *f zend_fcall_info fci; fci.size = sizeof(fci); - fci.function_table = EG(function_table); ZVAL_COPY_VALUE(&fci.function_name, handler); - fci.symbol_table = NULL; fci.object = Z_OBJ(parser->object); fci.retval = retval; fci.param_count = argc; @@ -581,7 +579,7 @@ PHP_XML_API zend_string *xml_utf8_encode(const char *s, size_t len, const XML_Ch } /* This is the theoretical max (will never get beyond len * 2 as long * as we are converting from single-byte characters, though) */ - str = zend_string_alloc(len * 4, 0); + str = zend_string_safe_alloc(len, 4, 0, 0); ZSTR_LEN(str) = 0; while (pos > 0) { c = encoder ? encoder((unsigned char)(*s)) : (unsigned short)(*s); @@ -1556,7 +1554,6 @@ PHP_FUNCTION(xml_parser_free) { zval *pind; xml_parser *parser; - zend_resource *res; if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pind) == FAILURE) { return; @@ -1571,9 +1568,10 @@ PHP_FUNCTION(xml_parser_free) RETURN_FALSE; } - res = Z_RES(parser->index); - ZVAL_UNDEF(&parser->index); - zend_list_close(res); + if (zend_list_delete(Z_RES(parser->index)) == FAILURE) { + RETURN_FALSE; + } + RETURN_TRUE; } /* }}} */ |