From 6fc9fdeefc7be3665e82bf8ec3861efff7de7c1a Mon Sep 17 00:00:00 2001 From: Sterling Hughes Date: Mon, 9 Jun 2003 03:29:33 +0000 Subject: [PATCH] simon says leaking is better than crashing --- ext/simplexml/simplexml.c | 9 +++++---- 1 file 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); } -- 2.50.1