summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Strojny <lstrojny@php.net>2013-01-14 21:35:48 +0100
committerLars Strojny <lstrojny@php.net>2013-01-14 21:35:48 +0100
commit6a065876b9212404daaf8fee1708834da83dac56 (patch)
treeec31cc1ab8e4a43af611260f9ab036ff24a04e30
parentbf9ad4e661be4f3eebe3511887e10e521cce7f93 (diff)
downloadphp-git-6a065876b9212404daaf8fee1708834da83dac56.tar.gz
Bug #52958: Segfault in PDO_OCI on cleanup after running a long testsuite.
-rw-r--r--NEWS2
-rw-r--r--ext/pdo_oci/oci_driver.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 16c0771756..58a50bb944 100644
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,8 @@ PHP NEWS
- PDO_sqlite:
. Fixed bug #63916 (PDO::PARAM_INT casts to 32bit int internally even
on 64bit builds in pdo_sqlite). (srgoogleguy, Lars)
+ . Fixed bug #52958 (Segfault in PDO_OCI on cleanup after running a long
+ testsuite) (hswong3i, Lars)
?? ??? 2012, PHP 5.4.11
diff --git a/ext/pdo_oci/oci_driver.c b/ext/pdo_oci/oci_driver.c
index a0377ddb1f..5497bebc64 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);