ID: 37194
Updated by: [EMAIL PROTECTED]
Reported By: ysuzuki at zend dot co dot jp
-Status: Assigned
+Status: Open
Bug Type: Informix related
Operating System: RedHat Linux
PHP Version: 4.4.2
Assigned To: danny
Previous Comments:
------------------------------------------------------------------------
[2006-04-27 03:34:44] ysuzuki at zend dot co dot jp
Sorry, 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
------------------------------------------------------------------------
[2006-04-26 02:14:08] ysuzuki at zend dot co dot jp
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);
#endif
------------------------------------------------------------------------
[2006-04-25 09:14:47] 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;
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37194&edit=1