From: Marcus Boerger Date: Sun, 26 Oct 2003 00:39:48 +0000 (+0000) Subject: Fix casting (the question is when & what should be freed here). X-Git-Tag: RELEASE_2_0_0RC1~83 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d95b23a51bfbfde4fe31561872070534e7a381f;p=php Fix casting (the question is when & what should be freed here). --- diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index f7a86a3d28..d0433b4bf7 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -360,7 +360,7 @@ _get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval **value TSRM if (node->children && node->children->type == XML_TEXT_NODE && !xmlIsBlankNode(node->children)) { contents = xmlNodeListGetString(node->doc, node->children, 1); if (contents) { - ZVAL_STRING(*value, contents, 0); + ZVAL_STRING(*value, contents, 1); } } else { subnode = php_sxe_object_new(TSRMLS_C); @@ -739,6 +739,8 @@ cast_object(zval *object, int type, char *contents TSRMLS_DC) { if (contents) { ZVAL_STRINGL(object, contents, strlen(contents), 1); + object->refcount = 1; + object->is_ref = 0; } switch (type) { @@ -794,7 +796,7 @@ sxe_object_cast(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_ xmlFree(contents); } if (should_free) { - zval_dtor(&free_obj); + /*zval_dtor(&free_obj);*/ } return rv; }