|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-04-25 09:14 UTC] ysuzuki at zend dot co dot jp
Description:
------------
Our developers created a sample code by using the following functions.
--- ifx_connect(), ifx_query(), ifx_free_result(), ifx_close()
This sample program is very simple such as connect to Infomix DB and then issue some query string, get query result, and finally disconnect Informix DB. They executed this sample php code several times. Then, they found a problem that HTTPD used memory was increased. This is kind of memory leak problem.
They also investigated php_initfx_count_descriptors() function.
static php_initfx_count_descriptors(char *p_statemid TSRMLS_DC)
{
EXEC SQL BEGIN DECLARE SECTION;
char *statemid = p_statemid;
EXEC SQL END DECLARE SECTION;
struct sqlda *s_da;
int ret = 384;
EXEC SQL DESCRIBE :statemid INTO s_da;
If(ifx_check()) >= 0) {
ret = s_da->sqlid;
/*
*Thanks to DBD-Informix
*/
#if (ESQLC_VERSION >= 720 || (ESQLC_VERSION >= 501 && ESQLC_VERSION < 600))
SqlFreeMem(s_da, SQLDA_FREE);
} else {
free(s_da);
#endif
}
return ret;
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 21 21:00:01 2025 UTC |
If it?s not match condition as follows, it will never free Informix memory, I think. (ESQLC_VERSION >= 720 || (ESQLC_VERSION >= 501 && ESQLC_VERSION < 600) I changed this portion is the following. After that, This problem was fixed. I believe this modification is right code. Please take it. #if (ESQLC_VERSION >= 720 || (ESQLC_VERSION >= 501 && ESQLC_VERSION < 600)) SqlFreeMem(s_da, SQLDA_FREE); } else { #else free(s_da); #endifSorry, Bug fixed right code is here. #if (ESQLC_VERSION >= 720 || (ESQLC_VERSION >= 501 && ESQLC_VERSION < 600)) SqlFreeMem(s_da, SQLDA_FREE); #else <-- *** I added this line *** free(s_da); #endif