]> granicus.if.org Git - php/commitdiff
increment refcount for arrays passed to xml_set_handler
authorRob Richards <rrichards@php.net>
Tue, 29 Jul 2003 13:34:50 +0000 (13:34 +0000)
committerRob Richards <rrichards@php.net>
Tue, 29 Jul 2003 13:34:50 +0000 (13:34 +0000)
ext/xml/xml.c

index 7aa0d91c673e5261d3c183d49b27d3e7b1056640..95a08c71e4f18aa9a54591f1518d77e2118ecd73 100644 (file)
@@ -382,9 +382,10 @@ static void xml_set_handler(zval **handler, zval **data)
        /* IS_ARRAY might indicate that we're using array($obj, 'method') syntax */
        if (Z_TYPE_PP(data) != IS_ARRAY) {
                convert_to_string_ex(data);
-               zval_add_ref(data);
        }
 
+       zval_add_ref(data);
+
        *handler = *data;
 }
 /* }}} */