--- a/xmlreader.c | |
+++ b/xmlreader.c | |
@@ -2262,8 +2262,10 @@ xmlFreeTextReader(xmlTextReaderPtr reader) { | |
reader->dict = NULL; | |
if ((reader->ctxt->vctxt.vstateTab != NULL) && | |
(reader->ctxt->vctxt.vstateMax > 0)){ | |
+#ifdef LIBXML_REGEXP_ENABLED | |
while (reader->ctxt->vctxt.vstateNr > 0) | |
xmlValidatePopElement(&reader->ctxt->vctxt, NULL, NULL, NULL); | |
+#endif /* LIBXML_REGEXP_ENABLED */ | |
xmlFree(reader->ctxt->vctxt.vstateTab); | |
reader->ctxt->vctxt.vstateTab = NULL; | |
reader->ctxt->vctxt.vstateMax = 0; |