registry: don't call xmlCleanupParser()
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 17 Jan 2022 03:51:48 +0000 (13:51 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 18 Jan 2022 05:03:24 +0000 (15:03 +1000)
From the documentation:
> It does not clean up parser state, it cleans up memory allocated by the library
> itself. It is a cleanup function for the XML library. It tries to reclaim all
> related global memory allocated for the library processing. [...]
> One should call xmlCleanupParser() only when the process has finished using the library.

http://xmlsoft.org/html/libxml-parser.html#xmlCleanupParser

Since we're a library ourselves we cannot know if something else in the same
proces uses the parser, so we must not call this.

Reported-by: M Hickford
src/registry.c

index 7198828..17b6650 100644 (file)
@@ -1197,7 +1197,6 @@ parse(struct rxkb_context *ctx, const char *path,
     success = true;
 error:
     xmlFreeDoc(doc);
-    xmlCleanupParser();
 
     return success;
 }