|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-03-22 10:26 UTC] tony2001@php.net
[2007-03-30 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 09:00:01 2025 UTC |
Description: ------------ I found that coll->append("string"); or coll->assignElem(n,"string"); 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. see: http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14250/oci18map001.htm#i448982 http://download-east.oracle.com/docs/cd/A58617_01/server.804/a58234/orl_func.htm#426353 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