summaryrefslogtreecommitdiff
path: root/xpath.c
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2020-09-18 19:15:27 +0200
committerNick Wellnhofer <wellnhofer@aevum.de>2020-09-18 19:15:27 +0200
commit8b88503a2762edcc14d958f4a80149baffe95be7 (patch)
tree4b4649ba561b04668915b05d6a6488738b054893 /xpath.c
parentb215c270fa3b1436314cc56654718bd12182cfec (diff)
downloadlibxml2-8b88503a2762edcc14d958f4a80149baffe95be7.tar.gz
Don't call xmlXPathInit directly
Call xmlInitParser which uses a lock to avoid race conditions. Fixes #184.
Diffstat (limited to 'xpath.c')
-rw-r--r--xpath.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xpath.c b/xpath.c
index 2850a1ac..311997fe 100644
--- a/xpath.c
+++ b/xpath.c
@@ -14234,7 +14234,7 @@ xmlXPathCtxtCompile(xmlXPathContextPtr ctxt, const xmlChar *str) {
return(comp);
#endif
- xmlXPathInit();
+ xmlInitParser();
pctxt = xmlXPathNewParserContext(str, ctxt);
if (pctxt == NULL)
@@ -14323,7 +14323,7 @@ xmlXPathCompiledEvalInternal(xmlXPathCompExprPtr comp,
if (comp == NULL)
return(-1);
- xmlXPathInit();
+ xmlInitParser();
#ifndef LIBXML_THREAD_ENABLED
reentance++;
@@ -14468,7 +14468,7 @@ xmlXPathEval(const xmlChar *str, xmlXPathContextPtr ctx) {
CHECK_CTXT(ctx)
- xmlXPathInit();
+ xmlInitParser();
ctxt = xmlXPathNewParserContext(str, ctx);
if (ctxt == NULL)