Re: [PATCH] Fix for bug 16888
| From: | Joseph Tate | Date: | Fri, 17 May 2002 09:07:51 +0000 |
| Subject: | Re: [PATCH] Fix for bug 16888 | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-84129@lists.php.net to get a copy of this message | ||
We'll try this again. Here's the patch in a .txt file.
----- Original Message -----
From: "Christian Stocker" <chregu@bitflux.ch>
To: "Joseph Tate" <jtate@mi-corporation.com>
Cc: "Php-Dev List" <php-dev@lists.php.net>
Sent: Thursday, May 16, 2002 7:23 PM
Subject: Re: [PHP-DEV] [PATCH] Fix for bug 16888
> On Thu, 16 May 2002, Joseph Tate wrote:
>
> > The following fixes bug 16888 so that Apache and IIS no longer crash on
> > Windows when using the domxml extension with more than 128 nodes. See
> > http://bugs.php.net/bug.php?id=16888 for details.
> >
> > Will the memory leak gurus please have a go at this and let me know what
> > problems arise? Also, please test on non Win platforms to make sure
that no
> > functionality is lost.
>
> i certainly will (but i'm not the memory leak guru :) ), but the patch
> didn't make it through the mailing list. can you put it somewhere online?
> or send it to me personally, i can put it then on my webserver.
>
> chregu
>
>
> --
> nam...christian stocker adr...bremgartnerstr. 66, ch-8003 zurich
> pho...+41 1 451 6021 www...http://phant.ch/chregu
> mob...+41 76 561 8860 ema...chregu@phant.ch
> wor...+41 1 240 5670 gpg...0x5CE1DECB
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
Index: php_domxml.c =================================================================== RCS file: /repository/php4/ext/domxml/php_domxml.c,v retrieving revision 1.151 diff -u -r1.151 php_domxml.c --- php_domxml.c 16 May 2002 21:59:24 -0000 1.151 +++ php_domxml.c 17 May 2002 09:04:35 -0000 @@ -577,12 +577,11 @@ static void php_free_xml_node(zend_rsrc_list_entry *rsrc TSRMLS_DC) { xmlNodePtr node = (xmlNodePtr) rsrc->ptr; - - if (node) { - zval *wrapper = dom_object_get_data(node); - if (wrapper) - zval_ptr_dtor(&wrapper); - } + + node_wrapper_dtor(node); + //Should add a test here to make sure that refcount is 0 before setting to null, + //and should move it to node_wrapper_dtor(); + dom_object_set_data(node, NULL); }
Index: php_domxml.c =================================================================== RCS file: /repository/php4/ext/domxml/php_domxml.c,v retrieving revision 1.151 diff -u -r1.151 php_domxml.c --- php_domxml.c 16 May 2002 21:59:24 -0000 1.151 +++ php_domxml.c 17 May 2002 09:04:35 -0000 @@ -577,12 +577,11 @@ static void php_free_xml_node(zend_rsrc_list_entry *rsrc TSRMLS_DC) { xmlNodePtr node = (xmlNodePtr) rsrc->ptr; - - if (node) { - zval *wrapper = dom_object_get_data(node); - if (wrapper) - zval_ptr_dtor(&wrapper); - } + + node_wrapper_dtor(node); + //Should add a test here to make sure that refcount is 0 before setting to null, + //and should move it to node_wrapper_dtor(); + dom_object_set_data(node, NULL); }