summaryrefslogtreecommitdiff
path: root/ext/dom/php_dom.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2008-09-16 00:38:45 +0000
committerIlia Alshanetsky <iliaa@php.net>2008-09-16 00:38:45 +0000
commite39d08794e33568e94ca948cd36bb2d3df33d6b3 (patch)
treeb9f7dd535ce14de625d4ead60de8ee7576a64c10 /ext/dom/php_dom.c
parentb845244370dd9f755972e0f833e39f0dcd289494 (diff)
downloadphp-git-e39d08794e33568e94ca948cd36bb2d3df33d6b3.tar.gz
Fixed bug #46087 (DOMXPath - segfault on destruction of a cloned object).
Diffstat (limited to 'ext/dom/php_dom.c')
-rw-r--r--ext/dom/php_dom.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c
index 38c8dfacab..1494e286fe 100644
--- a/ext/dom/php_dom.c
+++ b/ext/dom/php_dom.c
@@ -965,8 +965,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);