Skip to content

Commit e39d087

Browse files
author
Ilia Alshanetsky
committed
Fixed bug #46087 (DOMXPath - segfault on destruction of a cloned object).
1 parent b845244 commit e39d087

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ PHP NEWS
66
- Changed error level E_ERROR into E_WARNING in Soap extension methods
77
parameter validation. (Felipe)
88

9+
- Fixed bug #46087 (DOMXPath - segfault on destruction of a cloned object).
10+
(Ilia)
911
- Fixed bug #46086 (Segfault when accessing fileinfo class properties).
1012
(Scott)
1113
- Fixed bug #46072 (Compile failure under IRIX 6.5.30 building util.c) (Greg)

ext/dom/php_dom.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -965,8 +965,10 @@ void dom_xpath_objects_free_storage(void *object TSRMLS_DC)
965965
intern->ptr = NULL;
966966
}
967967

968-
zend_hash_destroy(intern->registered_phpfunctions);
969-
FREE_HASHTABLE(intern->registered_phpfunctions);
968+
if (intern->registered_phpfunctions) {
969+
zend_hash_destroy(intern->registered_phpfunctions);
970+
FREE_HASHTABLE(intern->registered_phpfunctions);
971+
}
970972

971973
if (intern->node_list) {
972974
zend_hash_destroy(intern->node_list);

0 commit comments

Comments
 (0)