diff options
author | Sterling Hughes <sterling@php.net> | 2003-07-02 20:05:13 +0000 |
---|---|---|
committer | Sterling Hughes <sterling@php.net> | 2003-07-02 20:05:13 +0000 |
commit | e158cd285e391a1ccd8402045545e524763dced7 (patch) | |
tree | ad6c8df3e5cbbfa58327781afead2910f6333d80 /ext/xml/xml.c | |
parent | eab449ded0996dab07c5f9dd8fa5bf929983d8e9 (diff) | |
download | php-git-e158cd285e391a1ccd8402045545e524763dced7.tar.gz |
Not really the best way to solve this. But it doesn't give a segfault on
self-referential structures, which is always a bonus
Diffstat (limited to 'ext/xml/xml.c')
-rw-r--r-- | ext/xml/xml.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 8353cfd8c1..241abee845 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -374,17 +374,17 @@ static void xml_parser_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ xml_set_handler() */ 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); - } - /* If we have already a handler, release it */ if (*handler) { zval_ptr_dtor(handler); } - zval_add_ref(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); + } + *handler = *data; } /* }}} */ |