Do not allocate memory to pick the best error

Parsing a 10MB file used to take 435 ms, but with this change it takes
402 (92.4% of the previous time). For reference, xmllint takes 312 ms
(we are 129.0% of xmllint).