Browse Source

fix mem leak in sxe_property_read

fix compiler warning
PEAR_1_4DEV
Rob Richards 23 years ago
parent
commit
a225934450
  1. 12
      ext/simplexml/simplexml.c

12
ext/simplexml/simplexml.c

@ -26,6 +26,7 @@
#include "php_ini.h"
#include "ext/standard/info.h"
#include "php_simplexml.h"
#include "zend_execute_locks.h"
zend_class_entry *sxe_class_entry;
@ -105,8 +106,7 @@ sxe_property_read(zval *object, zval *member TSRMLS_DC)
xmlAttrPtr attr;
int counter = 0;
ALLOC_ZVAL(return_value);
return_value->refcount = 0;
MAKE_STD_ZVAL(return_value);
ZVAL_NULL(return_value);
name = Z_STRVAL_P(member);
@ -146,7 +146,6 @@ sxe_property_read(zval *object, zval *member TSRMLS_DC)
if (match_ns(sxe, node, name)) {
MAKE_STD_ZVAL(value);
_node_as_zval(sxe, node->parent, value TSRMLS_CC);
value->refcount = 0;
APPEND_CUR_ELEMENT(counter, value);
goto next_iter;
}
@ -156,8 +155,6 @@ sxe_property_read(zval *object, zval *member TSRMLS_DC)
APPEND_PREV_ELEMENT(counter, value);
MAKE_STD_ZVAL(value);
_node_as_zval(sxe, node, value TSRMLS_CC);
value->refcount = 0;
APPEND_CUR_ELEMENT(counter, value);
}
@ -173,6 +170,9 @@ next_iter:
return_value = value;
}
/* create temporary variable */
PZVAL_UNLOCK(return_value);
return return_value;
}
/* }}} */
@ -207,7 +207,7 @@ sxe_property_write(zval *object, zval *member, zval *value TSRMLS_DC)
php_sxe_object *sxe;
char *name;
xmlNodePtr node;
xmlNodePtr newnode;
xmlNodePtr newnode = NULL;
xmlAttrPtr attr;
int counter = 0;
int is_attr = 0;

Loading…
Cancel
Save