From: Ilia Alshanetsky Date: Mon, 5 May 2008 23:00:13 +0000 (+0000) Subject: MFB: Fixed bug #44798 (Memory leak assigning value to attribute). X-Git-Tag: RELEASE_1_2_5~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8fde9d770140327f2245956cdb680ac91deee866;p=php MFB: Fixed bug #44798 (Memory leak assigning value to attribute). --- diff --git a/NEWS b/NEWS index 9255645ade..30865878bf 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ PHP NEWS functions. (Andrey) - Fixed bug #44891 Memory leak using registerPHPFunctions and XSLT Variable as function parameter. (Rob) +- Fixed bug #44798 (Memory leak assigning value to attribute). (Ilia) 01 May 2008, PHP 5.2.6 - Fixed two possible crashes inside posix extension (Tony) diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index c1a030065b..c0659e9f07 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -695,11 +695,12 @@ static zval** sxe_property_get_adr(zval *object, zval *member TSRMLS_DC) /* {{{ convert_to_string(member); name = Z_STRVAL_P(member); node = sxe_get_element_by_name(sxe, node, &name, &type TSRMLS_CC); - if (!node) { - sxe_prop_dim_write(object, member, NULL, 1, 0, &node TSRMLS_CC); - type = SXE_ITER_NONE; - name = NULL; + if (node) { + return NULL; } + sxe_prop_dim_write(object, member, NULL, 1, 0, &node TSRMLS_CC); + type = SXE_ITER_NONE; + name = NULL; MAKE_STD_ZVAL(return_value); _node_as_zval(sxe, node, return_value, type, name, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);