File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -321,6 +321,7 @@ int dom_xpath_document_read(dom_object *obj, zval **retval TSRMLS_DC)
321
321
xmlDoc * docp = NULL ;
322
322
xmlXPathContextPtr ctx ;
323
323
int ret ;
324
+ zval * tmp ;
324
325
325
326
ctx = (xmlXPathContextPtr ) obj -> ptr ;
326
327
@@ -329,10 +330,16 @@ int dom_xpath_document_read(dom_object *obj, zval **retval TSRMLS_DC)
329
330
}
330
331
331
332
ALLOC_ZVAL (* retval );
333
+ tmp = * retval ;
334
+
332
335
if (NULL == (* retval = php_dom_create_object ((xmlNodePtr ) docp , & ret , * retval , obj TSRMLS_CC ))) {
336
+ FREE_ZVAL (tmp );
333
337
php_error_docref (NULL TSRMLS_CC , E_WARNING , "Cannot create required DOM object" );
334
338
return FAILURE ;
335
339
}
340
+ if (tmp != * retval ) {
341
+ FREE_ZVAL (tmp );
342
+ }
336
343
return SUCCESS ;
337
344
}
338
345
/* }}} */
You can’t perform that action at this time.
0 commit comments