rrichards               Wed Jan 30 15:28:46 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/libxml libxml.c 
  Log:
  MFH: fix bug #41562 (SimpleXML memory issue)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/libxml/libxml.c?r1=1.32.2.7.2.15.2.3&r2=1.32.2.7.2.15.2.4&diff_format=u
Index: php-src/ext/libxml/libxml.c
diff -u php-src/ext/libxml/libxml.c:1.32.2.7.2.15.2.3 
php-src/ext/libxml/libxml.c:1.32.2.7.2.15.2.4
--- php-src/ext/libxml/libxml.c:1.32.2.7.2.15.2.3       Mon Dec 31 07:17:09 2007
+++ php-src/ext/libxml/libxml.c Wed Jan 30 15:28:46 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: libxml.c,v 1.32.2.7.2.15.2.3 2007/12/31 07:17:09 sebastian Exp $ */
+/* $Id: libxml.c,v 1.32.2.7.2.15.2.4 2008/01/30 15:28:46 rrichards Exp $ */
 
 #define IS_EXT_MODULE
 
@@ -141,24 +141,6 @@
 /* }}} */
 
 /* {{{ internal functions for interoperability */
-static int php_libxml_dec_node(php_libxml_node_ptr *nodeptr)
-{
-       int ret_refcount;
-
-       ret_refcount = --nodeptr->refcount;
-       if (ret_refcount == 0) {
-               if (nodeptr->node != NULL && nodeptr->node->type != 
XML_DOCUMENT_NODE) {
-                       nodeptr->node->_private = NULL;
-               }
-               /* node is destroyed by another object. reset ret_refcount to 1 
and node to NULL
-               so the php_libxml_node_ptr is detroyed when the object is 
destroyed */
-               nodeptr->refcount = 1;
-               nodeptr->node = NULL;
-       }
-
-       return ret_refcount;
-}
-
 static int php_libxml_clear_object(php_libxml_node_object *object TSRMLS_DC)
 {
        if (object->properties) {
@@ -179,7 +161,10 @@
                if (wrapper) {
                        php_libxml_clear_object(wrapper TSRMLS_CC);
                } else {
-                       php_libxml_dec_node(nodeptr);
+                       if (nodeptr->node != NULL && nodeptr->node->type != 
XML_DOCUMENT_NODE) {
+                               nodeptr->node->_private = NULL;
+                       }
+                       nodeptr->node = NULL;
                }
        }
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to