Skip to content

Commit eaf2740

Browse files
committed
Merge branch 'PHP-8.3'
* PHP-8.3: Fix potential memory leak in XPath evaluation results
2 parents 586153b + 0f79c22 commit eaf2740

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ext/dom/xpath_callbacks.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,9 @@ static zval *php_dom_xpath_callback_fetch_args(xmlXPathParserContextPtr ctxt, ui
365365
}
366366
break;
367367
default:
368-
ZVAL_STRING(param, (char *)xmlXPathCastToString(obj));
368+
char *str = (char *)xmlXPathCastToString(obj);
369+
ZVAL_STRING(param, str);
370+
xmlFree(str);
369371
break;
370372
}
371373
xmlXPathFreeObject(obj);

0 commit comments

Comments
 (0)