]> granicus.if.org Git - php/commitdiff
Fix casting (the question is when & what should be freed here).
authorMarcus Boerger <helly@php.net>
Sun, 26 Oct 2003 00:39:48 +0000 (00:39 +0000)
committerMarcus Boerger <helly@php.net>
Sun, 26 Oct 2003 00:39:48 +0000 (00:39 +0000)
ext/simplexml/simplexml.c

index f7a86a3d2814150a31e65e339bb7fbe03f2f2a01..d0433b4bf7ca59b419b6394c1b1616e59fefcaea 100644 (file)
@@ -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;
 }