php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53281 pdo_firebird memory leaks bound parameters
Submitted: 2010-11-09 17:22 UTC Modified: 2016-12-13 09:52 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: popescu_dumitru at yahoo dot com Assigned: mariuz (profile)
Status: Closed Package: PDO Firebird
PHP Version: 5.3.3 OS: Fedora 13
Private report: No CVE-ID: None
 [2010-11-09 17:22 UTC] popescu_dumitru at yahoo dot com
Description:
------------
php CLI reports memory leaks when running the script provided

Test script:
---------------
<?php

        $dbh = new PDO("firebird:dbname=localhost:/tmp/test.gdb", "SYSDBA", "masterkey");

        $stmt2 = "SELECT B, C FROM test WHERE A = ? AND B = ?";

        $stmth2 = $dbh->prepare($stmt2);
        $stmth2->execute(array('A', 'B'));
        $rows = $stmth2->fetchAll();
        var_dump($rows);

        $dbh = NULL;
?>


Actual result:
--------------
/root/src/php-5.3.3/ext/pdo/pdo_stmt.c(472) :  Freeing 0x08D48B0C (2 bytes), script=tpdof3.php
/root/src/php-5.3.3/Zend/zend_variables.c(120) : Actual location (location was relayed)
Last leak repeated 1 time
=== Total 2 memory leaks detected ===


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-17 22:06 UTC] felipe@php.net
-Summary: memory leak in pdo_stmt.c +Summary: pdo_firebird memory leaks bound parameters
 [2011-12-11 17:32 UTC] mariuz@php.net
-Assigned To: +Assigned To: mariuz
 [2014-01-01 12:47 UTC] felipe@php.net
-Package: PDO related +Package: PDO Firebird
 [2016-12-12 19:13 UTC] dorin dot marcoci at gmail dot com
Tested this report on current branch master/7.2. Issue is not reproducible.
Probably it was fixed during previous commits.

D:\Projects\Php\phpdev\vc14\x64>x64\Debug_TS\php.exe x64\Debug_TS\test.php
array(1) {
  [0]=>
  array(2) {
    ["B"]=>
    string(1) "B"
    ["C"]=>
    string(1) "C"
  }
}
OK!
D:\Projects\Php\phpdev\vc14\x64>

DDL:

SET SQL DIALECT 3;

CREATE TABLE TEST (
    A  DT_CHAR /* DT_CHAR = VARCHAR(1) */,
    B  DT_CHAR /* DT_CHAR = VARCHAR(1) */,
    C  DT_CHAR /* DT_CHAR = VARCHAR(1) */
);

COMMIT;

INSERT INTO TEST (A, B, C)
          VALUES ('A', 'B', 'C');

COMMIT;
 [2016-12-13 09:52 UTC] mariuz@php.net
-Status: Assigned +Status: Closed
 [2016-12-13 09:52 UTC] mariuz@php.net
Closed , thanks for the report and testing
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 21:01:30 2024 UTC