Skip to content

Commit cf959ae

Browse files
committed
Share existing doc ref to avoid premature xmlDoc free.
NULL creates a disconnected php_libxml_ref_obj which frees the xmlDoc on zval_ptr_dtor while the node still references it.
1 parent 26c37cf commit cf959ae

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ext/xsl/xsltprocessor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ PHP_METHOD(XSLTProcessor, importStylesheet)
196196
RETURN_THROWS();
197197
}
198198

199-
php_dom_create_object((xmlNodePtr) nodep->doc, &owner_zv, NULL);
199+
php_dom_create_object((xmlNodePtr) nodep->doc, &owner_zv, php_dom_obj_from_obj(Z_OBJ_P(docp)));
200200
docp = &owner_zv;
201201
}
202202

0 commit comments

Comments
 (0)