]> granicus.if.org Git - php/commitdiff
fix memleak in sxe_prop_dim_read()
authorNuno Lopes <nlopess@php.net>
Sun, 24 Jun 2007 11:41:12 +0000 (11:41 +0000)
committerNuno Lopes <nlopess@php.net>
Sun, 24 Jun 2007 11:41:12 +0000 (11:41 +0000)
#found by coverity

ext/simplexml/simplexml.c

index 9000ac5892688d7b8a088f88e507da794fccdbae..a62151d8847f044b51b3fbf11782595aa648805b 100644 (file)
@@ -271,9 +271,6 @@ static zval * sxe_prop_dim_read(zval *object, zval *member, zend_bool elements,
                name = Z_STRVAL_P(member);
        }
 
-       MAKE_STD_ZVAL(return_value);
-       ZVAL_NULL(return_value);
-
        GET_NODE(sxe, node);
 
        if (sxe->iter.type == SXE_ITER_ATTRLIST) {
@@ -294,6 +291,9 @@ static zval * sxe_prop_dim_read(zval *object, zval *member, zend_bool elements,
                }
        }
 
+       MAKE_STD_ZVAL(return_value);
+       ZVAL_NULL(return_value);
+
        if (node) {
                if (attribs) {
                        if (Z_TYPE_P(member) != IS_LONG || sxe->iter.type == SXE_ITER_ATTRLIST) {