From a189edb7e7a6ec0009253df80d3e5a3138cb578f Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Fri, 15 Feb 2008 23:49:21 +0000 Subject: [PATCH] MHB: Bug #44113 (New collection creation can fail with OCI-22303) --- ext/oci8/oci8_collection.c | 10 +++++-- ext/oci8/tests/bug44113.phpt | 53 ++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 ext/oci8/tests/bug44113.phpt diff --git a/ext/oci8/oci8_collection.c b/ext/oci8/oci8_collection.c index 143790f366..528c574bce 100644 --- a/ext/oci8/oci8_collection.c +++ b/ext/oci8/oci8_collection.c @@ -44,9 +44,9 @@ /* {{{ php_oci_collection_create() Create and return connection handle */ -php_oci_collection * php_oci_collection_create(php_oci_connection* connection, zstr tdo, int tdo_len, zstr schema, int schema_len TSRMLS_DC) +php_oci_collection * php_oci_collection_create(php_oci_connection *connection, zstr tdo, int tdo_len, zstr schema, int schema_len TSRMLS_DC) { - dvoid *dschp1; + dvoid *dschp1 = NULL; dvoid *parmp1; dvoid *parmp2; php_oci_collection *collection; @@ -219,11 +219,17 @@ php_oci_collection * php_oci_collection_create(php_oci_connection* connection, z goto CLEANUP; } + /* free the describe handle (Bug #44113) */ + PHP_OCI_CALL(OCIHandleFree, ((dvoid *) dschp1, OCI_HTYPE_DESCRIBE)); PHP_OCI_REGISTER_RESOURCE(collection, le_collection); return collection; CLEANUP: + if (dschp1) { + /* free the describe handle (Bug #44113) */ + PHP_OCI_CALL(OCIHandleFree, ((dvoid *) dschp1, OCI_HTYPE_DESCRIBE)); + } php_oci_error(connection->err, connection->errcode TSRMLS_CC); php_oci_collection_close(collection TSRMLS_CC); return NULL; diff --git a/ext/oci8/tests/bug44113.phpt b/ext/oci8/tests/bug44113.phpt new file mode 100644 index 0000000000..646f09b7c7 --- /dev/null +++ b/ext/oci8/tests/bug44113.phpt @@ -0,0 +1,53 @@ +--TEST-- +Bug #44113 (New collection creation can fail with OCI-22303) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +Completed 70000 +Done -- 2.50.1