Fix potential double-free in xmlXPtrStringRangeFunction

Fix double-free in an unlikely error condition. Thanks to Wentao Liang
for the report.

Fixes #341.
This commit is contained in:
Nick Wellnhofer 2022-03-05 18:25:16 +01:00
parent c7dfba9cf4
commit 169f86b7fb

View File

@ -2756,6 +2756,7 @@ xmlXPtrStringRangeFunction(xmlXPathParserContextPtr ctxt, int nargs) {
*/
tmp = xmlXPtrNewLocationSetNodeSet(set->nodesetval);
xmlXPathFreeObject(set);
set = NULL;
if (tmp == NULL) {
xmlXPathErr(ctxt, XPATH_MEMORY_ERROR);
goto error;