mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix memory leak exhibited by bug_aaa.phpt
Since a statement may be executed multiple times, we need to free already allocated storage for output data before allocating new storage.
This commit is contained in:
parent
ba0913a2e5
commit
ae21dc46da
1 changed files with 3 additions and 0 deletions
|
@ -104,6 +104,9 @@ static int firebird_stmt_execute(pdo_stmt_t *stmt) /* {{{ */
|
|||
unsigned int i;
|
||||
for (i = 0; i < S->out_sqlda.sqld; i++) {
|
||||
XSQLVAR *var = &S->out_sqlda.sqlvar[i];
|
||||
if (var->sqlind) {
|
||||
efree(var->sqlind);
|
||||
}
|
||||
var->sqlind = (void*)ecalloc(1, var->sqllen + 2 * sizeof(short));
|
||||
var->sqldata = &((char*)var->sqlind)[sizeof(short)];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue