From: Moriyoshi Koizumi Date: Thu, 2 Oct 2003 19:45:05 +0000 (+0000) Subject: A temporary voodoo hack to avoid memory leaks. X-Git-Tag: BEFORE_HANDLERS_RESHUFFLE~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d7398813c371f2988ed72a07415b52b3b9ebf80b;p=php A temporary voodoo hack to avoid memory leaks. # Stuff of this kind must be removed if any neater way is out there. --- diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 3f08e2b19d..eab901911c 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -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 } /* }}} */