summaryrefslogtreecommitdiff
path: root/ext/xsl/php_xsl.c
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2005-03-02 18:27:25 +0000
committerRob Richards <rrichards@php.net>2005-03-02 18:27:25 +0000
commitc90305cb2ebd586681154b41ef89f8f181eea1d7 (patch)
treeaffbd4900d5f23d1c833d8d17f7ba73d9a345b41 /ext/xsl/php_xsl.c
parent4d5599f6e011aa8a3841bbbcfbd947368d1172c6 (diff)
downloadphp-git-c90305cb2ebd586681154b41ef89f8f181eea1d7.tar.gz
Fixed bug #31033 (php:function(string, nodeset) with xsl:key crashes PHP)
- only in 5.1 branch for now due to significance of change
Diffstat (limited to 'ext/xsl/php_xsl.c')
-rw-r--r--ext/xsl/php_xsl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c
index 904739a265..4303e0140f 100644
--- a/ext/xsl/php_xsl.c
+++ b/ext/xsl/php_xsl.c
@@ -83,6 +83,11 @@ void xsl_objects_free_storage(void *object TSRMLS_DC)
FREE_HASHTABLE(intern->node_list);
}
+ if (intern->doc) {
+ php_libxml_decrement_doc_ref(intern->doc TSRMLS_CC);
+ efree(intern->doc);
+ }
+
if (intern->ptr) {
/* free wrapper */
if (((xsltStylesheetPtr) intern->ptr)->_private != NULL) {
@@ -112,6 +117,7 @@ zend_object_value xsl_objects_new(zend_class_entry *class_type TSRMLS_DC)
intern->hasKeys = 0;
intern->registerPhpFunctions = 0;
intern->node_list = NULL;
+ intern->doc = NULL;
ALLOC_HASHTABLE(intern->std.properties);
zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);