From: Ilia Alshanetsky Date: Tue, 16 Sep 2008 00:38:55 +0000 (+0000) Subject: MFB: Fixed bug #46087 (DOMXPath - segfault on destruction of a cloned X-Git-Tag: BEFORE_HEAD_NS_CHANGE~376 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=815ac6539a41f9cba18a2440dc9d70179ba3ccab;p=php MFB: Fixed bug #46087 (DOMXPath - segfault on destruction of a cloned object). --- 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);