]> granicus.if.org Git - php/commitdiff
A temporary voodoo hack to avoid memory leaks.
authorMoriyoshi Koizumi <moriyoshi@php.net>
Thu, 2 Oct 2003 19:45:05 +0000 (19:45 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Thu, 2 Oct 2003 19:45:05 +0000 (19:45 +0000)
# Stuff of this kind must be removed if any neater way is out there.

ext/simplexml/simplexml.c

index 3f08e2b19de0224a9c099b80434507691fff99da..eab901911c01a340114649dd5f7522baf421c1c1 100644 (file)
@@ -269,6 +269,7 @@ next_iter:
 static zval **
 sxe_property_get_ptr(zval *object, zval *member TSRMLS_DC)
 {
+#if 0
        zval **property_ptr;
        zval  *property;
 
@@ -279,6 +280,22 @@ sxe_property_get_ptr(zval *object, zval *member TSRMLS_DC)
        *property_ptr = property;
        
        return property_ptr;
+#else
+       /* necessary voodoo hack */
+       struct compounded_zval_ptr {
+               zval zv;
+               zval *pzv;
+       };
+
+       zval  *property;
+
+       property = sxe_property_read(object, member, 0 TSRMLS_CC);
+       property = erealloc(property, sizeof(struct compounded_zval_ptr));
+
+       ((struct compounded_zval_ptr *)property)->pzv = property;
+       
+       return &((struct compounded_zval_ptr *)property)->pzv;
+#endif
 }
 /* }}} */