mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-01-13 13:17:36 +03:00
xpath: Report malloc failure in xmlXPathTranslateFunction
This commit is contained in:
parent
1a66b17605
commit
2963a097b9
8
xpath.c
8
xpath.c
@ -8305,7 +8305,7 @@ xmlXPathTranslateFunction(xmlXPathParserContextPtr ctxt, int nargs) {
|
||||
int offset, max;
|
||||
int ch;
|
||||
const xmlChar *point;
|
||||
xmlChar *cptr;
|
||||
xmlChar *cptr, *content;
|
||||
|
||||
CHECK_ARITY(3);
|
||||
|
||||
@ -8355,7 +8355,11 @@ xmlXPathTranslateFunction(xmlXPathParserContextPtr ctxt, int nargs) {
|
||||
}
|
||||
}
|
||||
|
||||
valuePush(ctxt, xmlXPathCacheNewString(ctxt, xmlBufContent(target)));
|
||||
content = xmlBufDetach(target);
|
||||
if (content == NULL)
|
||||
xmlXPathPErrMemory(ctxt);
|
||||
else
|
||||
valuePush(ctxt, xmlXPathCacheWrapString(ctxt, content));
|
||||
xmlBufFree(target);
|
||||
error:
|
||||
xmlXPathReleaseObject(ctxt->context, str);
|
||||
|
Loading…
Reference in New Issue
Block a user