Bug #47414 [Opn]: PDO_Firebird memory leaks when using bindColumn()
| From: | kalle@php.net | Date: | Fri, 18 Jun 2010 03:10:23 +0000 |
| Subject: | Bug #47414 [Opn]: PDO_Firebird memory leaks when using bindColumn() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-151594@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=47414&edit=1
ID: 47414
Updated by: kalle@php.net
Reported by: felipe@php.net
Summary: PDO_Firebird memory leaks when using bindColumn()
Status: Open
Type: Bug
Package: PDO related
Operating System: *
PHP Version: 5.3CVS-2009-02-16 (CVS)
New Comment:
Looking thru the code, within firebird_statement.c there is a couple of
slprintf() calls, they are malloc()'d, and later efree()'s which I guess
could cause this
Previous Comments:
------------------------------------------------------------------------
[2009-02-20 19:40:53] cruzader at gmx dot de
Using: PHP 5.2.9RC2 (cli) (built: Feb 19 2009 16:29:53)
OS: OpenSuse 10.3
Description:
----------------
Any error with PDO will result in a memory leak.
Reproduce code:
----------------
while (1) {
$test = new PDO($db['dsn'], $db['username'], $db['password']);
print "\n".memory_get_usage();
}
------------------------------------------------------------------------
[2009-02-16 22:31:07] felipe@php.net
Description:
------------
See below.
Reproduce code:
---------------
<?php
$db = new PDO('firebird:dbname=...', 'sysdba', 'foo');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
@$db->exec('drop table test');
$db->exec('CREATE TABLE test(idx int NOT NULL PRIMARY KEY, txt
VARCHAR(20))');
$db->exec('INSERT INTO test VALUES(0, \'String0\')');
$stmt = $db->prepare('SELECT idx, txt FROM test ORDER by idx');
$idx = $txt = 0;
$stmt->bindColumn('IDX', $idx);
$stmt->bindColumn('TXT', $txt);
$stmt->execute();
while($stmt->fetch(PDO::FETCH_BOUND)) {
var_dump(array($idx=>$txt));
}
Actual result:
--------------
array(1) {
[0]=>
string(7) "String0"
}
[Mon Feb 16 19:30:09 2009] Script: '../test.php'
/home/felipe/dev/php5/main/spprintf.c(775) : Freeing 0x090E8A64 (79
bytes), script=../test.php
Last leak repeated 1 time
=== Total 2 memory leaks detected ===
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=47414&edit=1