1
0
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:
Nick Wellnhofer 2023-02-28 12:14:33 +01:00
parent f560065f4d
commit 282b75f110

View File

@ -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));
}