From: Sterling Hughes Date: Mon, 9 Jun 2003 03:29:33 +0000 (+0000) Subject: simon says leaking is better than crashing X-Git-Tag: RELEASE_1_0_2~347 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6fc9fdeefc7be3665e82bf8ec3861efff7de7c1a;p=php simon says leaking is better than crashing --- 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); }