From fa81e849be745faa922d312cb7380c4cf22b6849 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Wed, 4 Jun 2025 20:42:39 +0200 Subject: [PATCH] xmllint: Fix --memory --repeat Always reset parser context. Should fix #937. --- xmllint.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xmllint.c b/xmllint.c index 1ee2f386e..f4233a5bc 100644 --- a/xmllint.c +++ b/xmllint.c @@ -3055,10 +3055,17 @@ xmllintMain(int argc, const char **argv, FILE *errStream, lint->ctxt = ctxt; for (j = 0; j < lint->repeat; j++) { + if (j > 0) { #ifdef LIBXML_PUSH_ENABLED - if ((lint->push) && (j > 0)) - xmlCtxtResetPush(ctxt, NULL, 0, NULL, NULL); + if (lint->push) { + xmlCtxtResetPush(ctxt, NULL, 0, NULL, NULL); + } else #endif + { + xmlCtxtReset(ctxt); + } + } + if (lint->sax) { testSAX(lint, filename); } else {