From: Sterling Hughes Date: Thu, 5 Jun 2003 17:48:51 +0000 (+0000) Subject: prevent double destroy and double init badness X-Git-Tag: RELEASE_1_0_2~412 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7b42eccfd6f6c36c2123f1a9d37f48dae2e13386;p=php prevent double destroy and double init badness --- 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; }