summaryrefslogtreecommitdiff
path: root/xpath.c
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2023-02-15 13:54:55 +0100
committerNick Wellnhofer <wellnhofer@aevum.de>2023-02-17 17:16:51 +0100
commitac746afd33a938b6704ba32824e076af939665fb (patch)
tree3aae3e1fda4afcbdc2a35b454187b93f5e12def8 /xpath.c
parent85bc313e7996c06d52b6f6f5c6a467ff3a148e75 (diff)
downloadlibxml2-ac746afd33a938b6704ba32824e076af939665fb.tar.gz
malloc-fail: Fix memory leak in xmlXPathTryStreamCompile
Found with libFuzzer, see #344.
Diffstat (limited to 'xpath.c')
-rw-r--r--xpath.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/xpath.c b/xpath.c
index 18e3d72c..6e7fc032 100644
--- a/xpath.c
+++ b/xpath.c
@@ -14138,6 +14138,7 @@ xmlXPathTryStreamCompile(xmlXPathContextPtr ctxt, const xmlChar *str) {
comp = xmlXPathNewCompExpr();
if (comp == NULL) {
xmlXPathErrMemory(ctxt, "allocating streamable expression\n");
+ xmlFreePattern(stream);
return(NULL);
}
comp->stream = stream;