]> granicus.if.org Git - php/commitdiff
prevent double destroy and double init badness
authorSterling Hughes <sterling@php.net>
Thu, 5 Jun 2003 17:48:51 +0000 (17:48 +0000)
committerSterling Hughes <sterling@php.net>
Thu, 5 Jun 2003 17:48:51 +0000 (17:48 +0000)
ext/xml/xml.c

index c43ea936c58e43af44571467bfa268f1a7fa2fa6..7a60a041a2e6154f42b25d0ef28ddcd7aa0e6df5 100644 (file)
@@ -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;
 }