summaryrefslogtreecommitdiff
path: root/ext/pdo_pgsql/pgsql_statement.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2016-08-09 11:32:34 +0800
committerXinchen Hui <laruence@gmail.com>2016-08-09 11:32:34 +0800
commit3f1e9ed8f8a809df5c1a2ca1ad13ea8859ea1425 (patch)
treeb78b72f39214c15268e4fa60fce327b71b4603fd /ext/pdo_pgsql/pgsql_statement.c
parent2ece5decb7c37d780c1e7df71de27fcf78cda0de (diff)
parente52cb1858d70251812d76c49f526019d487aa762 (diff)
downloadphp-git-3f1e9ed8f8a809df5c1a2ca1ad13ea8859ea1425.tar.gz
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: Fixed bug #72788 (Invalid memory access when using persistent PDO connection) Remove typo'd commit Fix bug 72788: Invalid memory access when database_object_handle is undefined. Also fix memory leak in dbh_free when using persistent PDO connections.
Diffstat (limited to 'ext/pdo_pgsql/pgsql_statement.c')
-rw-r--r--ext/pdo_pgsql/pgsql_statement.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c
index 53fea1623a..fe4c3c0850 100644
--- a/ext/pdo_pgsql/pgsql_statement.c
+++ b/ext/pdo_pgsql/pgsql_statement.c
@@ -61,7 +61,8 @@
static int pgsql_stmt_dtor(pdo_stmt_t *stmt)
{
pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
- zend_bool server_obj_usable = IS_OBJ_VALID(EG(objects_store).object_buckets[Z_OBJ_HANDLE(stmt->database_object_handle)])
+ zend_bool server_obj_usable = !Z_ISUNDEF(stmt->database_object_handle)
+ && IS_OBJ_VALID(EG(objects_store).object_buckets[Z_OBJ_HANDLE(stmt->database_object_handle)])
&& !(GC_FLAGS(Z_OBJ(stmt->database_object_handle)) & IS_OBJ_FREE_CALLED);
if (S->result) {