]> granicus.if.org Git - php/commitdiff
MFB: Fixed bug #46087 (DOMXPath - segfault on destruction of a cloned
authorIlia Alshanetsky <iliaa@php.net>
Tue, 16 Sep 2008 00:38:55 +0000 (00:38 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 16 Sep 2008 00:38:55 +0000 (00:38 +0000)
object).

ext/dom/php_dom.c

index bc6b0074e8498cc48f3cc21f141ff50ef59bd5fe..14a5d4cca9b390a0c2e538af5193ade6a17295d7 100644 (file)
@@ -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);