summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql/mysql_statement.c
diff options
context:
space:
mode:
authorKeyur <kgovande@etsy.com>2016-08-08 23:34:00 +0000
committerKeyur <kgovande@etsy.com>2016-08-09 00:16:46 +0000
commit3f25c4228a8f505a000c1ea5751062606247349a (patch)
tree05caf1efdb75d6704da598e1de007e391420bf40 /ext/pdo_mysql/mysql_statement.c
parentbe77ce37fd3290365a359f7143cc636d66f14cf1 (diff)
downloadphp-git-3f25c4228a8f505a000c1ea5751062606247349a.tar.gz
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_mysql/mysql_statement.c')
-rw-r--r--ext/pdo_mysql/mysql_statement.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c
index b141de79ef..4a2146dd16 100644
--- a/ext/pdo_mysql/mysql_statement.c
+++ b/ext/pdo_mysql/mysql_statement.c
@@ -88,7 +88,8 @@ static int pdo_mysql_stmt_dtor(pdo_stmt_t *stmt) /* {{{ */
}
#endif
- if (IS_OBJ_VALID(EG(objects_store).object_buckets[Z_OBJ_HANDLE(stmt->database_object_handle)])
+ if (!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))) {
while (mysql_more_results(S->H->server)) {
MYSQL_RES *res;