From: Rob Richards Date: Tue, 6 Apr 2004 17:56:11 +0000 (+0000) Subject: Fix Bug #27769 crash using domxml_xmltree X-Git-Tag: php-4.3.6RC3~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fa843198d4a5e82d646ee8932cc76b349e17e6d5;p=php Fix Bug #27769 crash using domxml_xmltree --- diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index 09b404456a..b52aa43b48 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -4803,15 +4803,17 @@ PHP_FUNCTION(domxml_xmltree) RETURN_FALSE; } - DOMXML_RET_OBJ(rv, (xmlNodePtr) docp, &ret); + DOMXML_DOMOBJ_NEW(rv, (xmlNodePtr) docp, &ret); /* The root itself maybe an array. Though you may not have two Elements as root, you may have a comment, pi and and element as root. Thanks to Paul DuBois for pointing me at this. */ if (node_children(&children, root TSRMLS_CC) >= 0) { - zend_hash_update(Z_OBJPROP_P(return_value), "children",sizeof("children"), (void *) &children, sizeof(zval *), NULL); + zend_hash_update(Z_OBJPROP_P(rv), "children",sizeof("children"), (void *) &children, sizeof(zval *), NULL); } + + DOMXML_RET_ZVAL(rv); /* xmlFreeDoc(docp); */ } /* }}} */