php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8573 Unnecessary Handle Allocation
Submitted: 2001-01-06 16:52 UTC Modified: 2001-01-07 06:45 UTC
From: tcarroll at chc-chimes dot com Assigned:
Status: Closed Package: OCI8 related
PHP Version: 4.0.4 OS: Linux 2.2.18
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 !
Your email address:
MUST BE VALID
Solve the problem:
20 + 20 = ?
Subscribe to this entry?

 
 [2001-01-06 16:52 UTC] tcarroll at chc-chimes dot com
The following details a non-fatal bug.  It results in a small memory-leak.
Within oci_execute(oci8.c), a
handle is allocated for OCIParam *param.

A call to OCIParamGet() follows in which
param is passed as an out variable.  After the call,
param receives a new handle value.  The original allocated handle was lost.  

The call to OCIHandleAlloc() is unnecessary
and results in unrecoverable memory.  A patch follows that
details the above said.  It has been tested successfully.

--- oci8.c.orig	Thu Nov 16 05:16:22 2000
+++ oci8.c	Sat Jan  6 16:13:24 2001
@@ -1219,12 +1219,6 @@
 		statement->columns = emalloc(sizeof(HashTable));
 		zend_hash_init(statement->columns, 13, NULL, _oci_column_hash_dtor, 0);
 		
-		OCIHandleAlloc(OCI(pEnv),
-					   (dvoid **)&param,
-					   OCI_DTYPE_PARAM,
-					   0,
-					   NULL);
-
 		counter = 1;
 
 		statement->error = 
@@ -1261,7 +1255,7 @@
 									   (dvoid *)statement->pStmt,
 									   OCI_HTYPE_STMT,
 									   statement->pError,
-									   (dvoid*)&param,
+									   (dvoid**)&param,
 									   counter));
 			if (statement->error) {
 				return 0; /* XXX we loose memory!!! */

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-07 06:45 UTC] thies@php.net
fixed in CVS (PHP 3 & 4) - thanx for spotting!
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Nov 29 15:05:53 2022 UTC