diff options
author | Moriyoshi Koizumi <moriyoshi@php.net> | 2003-10-02 19:45:05 +0000 |
---|---|---|
committer | Moriyoshi Koizumi <moriyoshi@php.net> | 2003-10-02 19:45:05 +0000 |
commit | d7398813c371f2988ed72a07415b52b3b9ebf80b (patch) | |
tree | 64a343a1250bdb53ef30b3f7fa5760227be0b51d | |
parent | 6745000c373658d0d1c5549a4456def404b1315f (diff) | |
download | php-git-d7398813c371f2988ed72a07415b52b3b9ebf80b.tar.gz |
A temporary voodoo hack to avoid memory leaks.
# Stuff of this kind must be removed if any neater way is out there.
-rw-r--r-- | ext/simplexml/simplexml.c | 17 |
1 files changed, 17 insertions, 0 deletions
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 } /* }}} */ |