Bug #47414 [Csd]: PDO_Firebird memory leaks when using bindColumn()

From: Date: Tue, 06 Dec 2016 17:52:21 +0000
Subject: Bug #47414 [Csd]: PDO_Firebird memory leaks when using bindColumn()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-205809@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=47414&edit=1 ID: 47414 Updated by: mariuz@php.net Reported by: felipe@php.net Summary: PDO_Firebird memory leaks when using bindColumn() Status: Closed Type: Bug Package: PDO Firebird Operating System: * PHP Version: 5.3CVS-2009-02-16 (CVS) Assigned To: mariuz Block user comment: N Private report: N New Comment: Seems that is solved , thanks for the report Previous Comments: ------------------------------------------------------------------------ [2016-12-06 17:19:04] dorin dot marcoci at gmail dot com Just tested provided script on current master branch. No memory leaks reported, all works just fine. Does anyone still have this issue? ------------------------------------------------------------------------ [2010-06-18 05:10:23] kalle@php.net 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 ------------------------------------------------------------------------ [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 https://bugs.php.net/bug.php?id=47414&edit=1

« previous php.bugs (#205809) next »