summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSterling Hughes <sterling@php.net>2003-06-09 03:29:33 +0000
committerSterling Hughes <sterling@php.net>2003-06-09 03:29:33 +0000
commit6fc9fdeefc7be3665e82bf8ec3861efff7de7c1a (patch)
tree05bfb23e13e18b8254ce327a539c38da958f6fc1
parent568aecd9734fc5b3788cc28c919579b61e77ded5 (diff)
downloadphp-git-6fc9fdeefc7be3665e82bf8ec3861efff7de7c1a.tar.gz
simon says leaking is better than crashing
-rw-r--r--ext/simplexml/simplexml.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index 365109e6c4..7eb522d785 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -783,12 +783,13 @@ sxe_object_dtor(void *object, zend_object_handle handle TSRMLS_DC)
sxe = (php_sxe_object *) object;
- FREE_HASHTABLE(sxe->zo.properties);
-
- if (--sxe->document->refcount <= 0) {
- xmlFreeDoc(sxe->document->ptr);
+ if (--sxe->document->refcount > 0) {
+ return;
}
+ xmlFreeDoc(sxe->document->ptr);
+ FREE_HASHTABLE(sxe->zo.properties);
+
if (sxe->xpath) {
xmlXPathFreeContext(sxe->xpath);
}