mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix leaks in dom_xpath_query (create retval only if requiered) by Pierre-Alain
This commit is contained in:
parent
00af01bb94
commit
6b70f9d1b3
1 changed files with 3 additions and 2 deletions
|
@ -211,8 +211,6 @@ PHP_FUNCTION(dom_xpath_query)
|
|||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
MAKE_STD_ZVAL(retval);
|
||||
array_init(retval);
|
||||
|
||||
if (xpathobjp->type == XPATH_NODESET) {
|
||||
int i;
|
||||
|
@ -223,6 +221,9 @@ PHP_FUNCTION(dom_xpath_query)
|
|||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
MAKE_STD_ZVAL(retval);
|
||||
array_init(retval);
|
||||
|
||||
for (i = 0; i < nodesetp->nodeNr; i++) {
|
||||
xmlNodePtr node = nodesetp->nodeTab[i];
|
||||
zval *child;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue