--- embedaddon/php/ext/xmlwriter/php_xmlwriter.c 2012/02/21 23:48:05 1.1.1.1 +++ embedaddon/php/ext/xmlwriter/php_xmlwriter.c 2013/07/22 01:32:10 1.1.1.3 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2012 The PHP Group | + | Copyright (c) 1997-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_xmlwriter.c,v 1.1.1.1 2012/02/21 23:48:05 misho Exp $ */ +/* $Id: php_xmlwriter.c,v 1.1.1.3 2013/07/22 01:32:10 misho Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -143,7 +143,6 @@ static void xmlwriter_object_free_storage(void *object static zend_object_value xmlwriter_object_new(zend_class_entry *class_type TSRMLS_DC) { ze_xmlwriter_object *intern; - zval *tmp; zend_object_value retval; intern = emalloc(sizeof(ze_xmlwriter_object)); @@ -151,8 +150,7 @@ static zend_object_value xmlwriter_object_new(zend_cla intern->xmlwriter_ptr = NULL; zend_object_std_init(&intern->zo, class_type TSRMLS_CC); - zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, - (void *) &tmp, sizeof(zval *)); + object_properties_init(&intern->zo, class_type); retval.handle = zend_objects_store_put(intern, NULL, @@ -616,6 +614,7 @@ static char *_xmlwriter_get_valid_file_path(char *sour /* absolute file uris - libxml only supports localhost or empty host */ if (strncasecmp(source, "file:///", 8) == 0) { if (source[sizeof("file:///") - 1] == '\0') { + xmlFreeURI(uri); return NULL; } isFileUri = 1; @@ -626,6 +625,7 @@ static char *_xmlwriter_get_valid_file_path(char *sour #endif } else if (strncasecmp(source, "file://localhost/",17) == 0) { if (source[sizeof("file://localhost/") - 1] == '\0') { + xmlFreeURI(uri); return NULL; } @@ -679,7 +679,7 @@ static void *php_xmlwriter_streams_IO_open_write_wrapp php_stream_wrapper *wrapper = NULL; void *ret_val = NULL; - ret_val = php_stream_open_wrapper_ex((char *)filename, "wb", ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL, NULL); + ret_val = php_stream_open_wrapper_ex((char *)filename, "wb", REPORT_ERRORS, NULL, NULL); return ret_val; } /* }}} */