]> granicus.if.org Git - php/commitdiff
fixed hopefully last XML problem. that one was hard!
authorThies C. Arntzen <thies@php.net>
Thu, 7 Oct 1999 12:27:40 +0000 (12:27 +0000)
committerThies C. Arntzen <thies@php.net>
Thu, 7 Oct 1999 12:27:40 +0000 (12:27 +0000)
ChangeLog
ext/xml/xml.c

index 3665a216450b06bf160341bbf0ebc53a15212d31..d04dd5a843eb142c5e08c099a45039b4b5656087 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@ PHP 4.0 CHANGE LOG                                                    ChangeLog
 
 ?? ?? 1999, Version 4.0 Beta 3
 
+- Fixed refcount problem in XML module. (Thies)
 - Fixed crash in HTTP_RAW_POST_DATA handling (Thies)
 - You can use resources as array-indices again (Thies, Zend library)
 - Fixed pg_fetch_array() with three arguments (Sascha)
index b8f1bf4bc4eafd339f221f5de35c248b0ba5c926..90a1f78589287408a1908360bac2078658fcae1b 100644 (file)
@@ -66,7 +66,6 @@ DLEXPORT zend_module_entry *get_module(void) { return &xml_module_entry; }
 /* }}} */
 /* {{{ function prototypes */
 
-
 PHP_MINIT_FUNCTION(xml);
 PHP_RINIT_FUNCTION(xml);
 PHP_MSHUTDOWN_FUNCTION(xml);
@@ -248,6 +247,8 @@ static zval *_xml_resource_zval(long value)
        ret->type = IS_RESOURCE;
        ret->value.lval = value;
 
+       zend_list_addref(value);
+
        return ret;
 }
 
@@ -365,7 +366,7 @@ xml_call_handler(xml_parser *parser, char *funcName, int argc, zval **argv)
 
                MAKE_STD_ZVAL(retval);
                retval->type = IS_BOOL;
-               retval->value.lval = IS_BOOL;
+               retval->value.lval = 0;
 
                /* We cannot call internal variables from a function module as
                   it breaks any chance of compiling it as a module on windows.
@@ -379,14 +380,13 @@ xml_call_handler(xml_parser *parser, char *funcName, int argc, zval **argv)
                        zval_dtor(retval);
                        efree(retval);
                }
-               zval_dtor(func);
-               efree(func);
+
+               zval_del_ref(&func);
+
                for (i = 0; i < argc; i++) {
-                       if (i != 0) { /* arg 0 is always our parser-resource - we don't wat to destruct that! */
-                               zval_dtor(argv[i]);
-                       }
-                       efree(argv[i]);
+                       zval_del_ref(&(argv[i]));
                }
+
                if (result == FAILURE) {
                        return NULL;
                } else {