#11353 [Com]: Memory leak in php_domxml.c, domxml_dumpmem
| From: | sex-black772 at hotmail dot com | Date: | Tue, 20 Jul 2004 15:05:56 +0000 |
| Subject: | #11353 [Com]: Memory leak in php_domxml.c, domxml_dumpmem | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-62958@lists.php.net to get a copy of this message | ||
ID: 11353
Comment by: sex-black772 at hotmail dot com
Reported By: tgagne at efinnet dot com
Status: Closed
Bug Type: DOM XML related
Operating System: RHat 6.2
PHP Version: 4.0.5
New Comment:
<a href=http://onlydirtygothic-foo.da.ru>sex
black</a>
Previous Comments:
------------------------------------------------------------------------
[2001-12-13 06:25:15] sander@php.net
No feedback. Closing.
------------------------------------------------------------------------
[2001-11-21 20:05:59] mfischer@php.net
Can't reproduce this with latest RC.
Can you try latest RC and see if the problem still exists
http://www.php.net/~zeev/php-4.1.0RC3.tar.gz
Feedback.
------------------------------------------------------------------------
[2001-06-08 06:28:42] tgagne at efinnet dot com
The memory allocated by xmlDumpMemory must be deallocated (free()'d).
The Zend/zend_API.h macro RETURN_STRINGL() doesn't do this. A
substitute (below) seems to do the trick.
#define FREE_RETURN_STRINGL(s,l,duplicate) { \
char *__s=(s); int __l=l; \
return_value->value.str.len = __l; \
return_value->value.str.val =
(duplicate?estrndup(__s,__l):__s); \
return_value->type = IS_STRING; \
free(s); \
return; \
}
I used this at the bottom of domxml_dumpmem() and can now do bunches of
dom functions without crashing Apache or the CGI.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=11353&edit=1