From e4427b4cc9046385f2e9cc0e9d173ff881dd7f48 Mon Sep 17 00:00:00 2001 From: Wong Hoi Sing Edison Date: Wed, 17 Oct 2012 14:24:16 +0800 Subject: [PATCH] Bug #57702 :: Multiple BLOB fetch fails. --- ext/pdo_oci/oci_driver.c | 6 ++++-- ext/pdo_oci/oci_statement.c | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ext/pdo_oci/oci_driver.c b/ext/pdo_oci/oci_driver.c index cb920ab14a268..3e2040e0c63b5 100644 --- a/ext/pdo_oci/oci_driver.c +++ b/ext/pdo_oci/oci_driver.c @@ -227,8 +227,10 @@ static int oci_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */ H->server = NULL; } - OCIHandleFree(H->err, OCI_HTYPE_ERROR); - H->err = NULL; + if (H->err) { + OCIHandleFree(H->err, OCI_HTYPE_ERROR); + H->err = NULL; + } if (H->charset && H->env) { OCIHandleFree(H->env, OCI_HTYPE_ENV); diff --git a/ext/pdo_oci/oci_statement.c b/ext/pdo_oci/oci_statement.c index da3542559fdb9..be51b6fb284d5 100644 --- a/ext/pdo_oci/oci_statement.c +++ b/ext/pdo_oci/oci_statement.c @@ -99,7 +99,7 @@ static int oci_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */ switch (S->cols[i].dtype) { case SQLT_BLOB: case SQLT_CLOB: - /* do nothing */ + OCIDescriptorFree(S->cols[i].data, OCI_DTYPE_LOB); break; default: efree(S->cols[i].data); @@ -654,7 +654,6 @@ static int oci_blob_close(php_stream *stream, int close_handle TSRMLS_DC) if (close_handle) { OCILobClose(self->S->H->svc, self->S->err, self->lob); - OCIDescriptorFree(self->lob, OCI_DTYPE_LOB); efree(self); }