From 815ac6539a41f9cba18a2440dc9d70179ba3ccab Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Tue, 16 Sep 2008 00:38:55 +0000 Subject: [PATCH] MFB: Fixed bug #46087 (DOMXPath - segfault on destruction of a cloned object). --- ext/dom/php_dom.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index bc6b0074e8..14a5d4cca9 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -954,8 +954,10 @@ void dom_xpath_objects_free_storage(void *object TSRMLS_DC) intern->ptr = NULL; } - zend_hash_destroy(intern->registered_phpfunctions); - FREE_HASHTABLE(intern->registered_phpfunctions); + if (intern->registered_phpfunctions) { + zend_hash_destroy(intern->registered_phpfunctions); + FREE_HASHTABLE(intern->registered_phpfunctions); + } if (intern->node_list) { zend_hash_destroy(intern->node_list); -- 2.50.1