blob: 17cd15a6b9eb41af33b7e146b5afac5c3c4979d2 [file] [log] [blame]
--- 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;