|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40889 Coll->assignElem(n,"str") and Coll->append("str") causes memory leak
Submitted: 2007-03-22 09:01 UTC Modified: 2007-03-30 01:00 UTC
From: uno at venus dot dti dot ne dot jp Assigned:
Status: No Feedback Package: OCI8 related
PHP Version: 4.4.6 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
2 + 39 = ?
Subscribe to this entry?

 [2007-03-22 09:01 UTC] uno at venus dot dti dot ne dot jp
I found that
cause memory leak.

You need to free OCIAssignText()'ed strings with OCIStringResize() in oci8.c (PHP 4.4.6) and oci8_collection.c (PHP 5.2.1, PECL/oci8-1.2.3) because OCICollAppend() and OCICollAssignElem() perform deep-copy of element value.


Reproduce code:
$collStr = ocinewcollection( ... );
$collStr->append("string");              /* memory leak */
$collStr->assignElem(0,"string");        /* memory leak */

$collNum = ocinewcollection( ... );
$collNum->append(1234);                  /* no memory leak */
$collNum->assignElem(0, 5678);           /* no memory leak */

$collDate = ocinewcollection( ... );
$collDate->append("2007-01-01");         /* no memory leak */
$collDate->assignElem(0, "2007-02-02");  /* no memory leak */

Expected result:
no memory leak

Actual result:
memory leak


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-22 10:26 UTC]
Are you using OCI8 from PECL?
If yes, which version?
 [2007-03-30 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 18:01:35 2024 UTC