From ac5e0e7c08d320709e02d4acaf8007710cf75938 Mon Sep 17 00:00:00 2001 From: Tpt Date: Sat, 4 Mar 2023 13:34:29 +0100 Subject: [PATCH] XML parser results: clears the temporary data buffer while parsing Avoids indefinitely increasing memory consumption --- lib/sparesults/src/xml.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/sparesults/src/xml.rs b/lib/sparesults/src/xml.rs index 5cfa4051..f3abdc0d 100644 --- a/lib/sparesults/src/xml.rs +++ b/lib/sparesults/src/xml.rs @@ -260,6 +260,7 @@ impl XmlQueryResultsReader { Event::Eof => return Err(SyntaxError::msg("Unexpected early file end. All results file should have a and a or tag").into()), _ => (), } + buffer.clear(); } } } @@ -533,6 +534,7 @@ impl XmlSolutionsReader { Event::Eof => return Ok(None), _ => (), } + self.buffer.clear(); } } }