diff options
Diffstat (limited to 'ext/xml/xml.c')
-rw-r--r-- | ext/xml/xml.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/xml/xml.c b/ext/xml/xml.c index c43ea936c5..7a60a041a2 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -35,6 +35,8 @@ #if HAVE_XML +int xml_parser_inited = 0; + #include "php_xml.h" # include "ext/standard/head.h" @@ -250,7 +252,10 @@ PHP_MSHUTDOWN_FUNCTION(xml) PHP_RSHUTDOWN_FUNCTION(xml) { #ifdef LIBXML_EXPAT_COMPAT - xmlCleanupParser(); + if (xml_parser_inited) { + xmlCleanupParser(); + xml_parser_inited = 0; + } #endif return SUCCESS; } |