mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-27 18:50:07 +03:00
malloc-fail: Fix memory leak in xmlXPathNameFunction
Found with libFuzzer, see #344.
This commit is contained in:
parent
f560065f4d
commit
282b75f110
5
xpath.c
5
xpath.c
@ -8875,9 +8875,8 @@ xmlXPathNameFunction(xmlXPathParserContextPtr ctxt, int nargs)
|
||||
NULL, 0);
|
||||
if (fullname == cur->nodesetval->nodeTab[i]->name)
|
||||
fullname = xmlStrdup(cur->nodesetval->nodeTab[i]->name);
|
||||
if (fullname == NULL) {
|
||||
XP_ERROR(XPATH_MEMORY_ERROR);
|
||||
}
|
||||
if (fullname == NULL)
|
||||
xmlXPathPErrMemory(ctxt, NULL);
|
||||
valuePush(ctxt, xmlXPathCacheWrapString(
|
||||
ctxt->context, fullname));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user