summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_ps.c
diff options
context:
space:
mode:
authorYussuf Khalil <dev@pp3345.net>2017-04-05 20:57:03 +0200
committerYussuf Khalil <dev@pp3345.net>2017-04-05 20:57:03 +0200
commit27120d4412a7122f27ac1fcd4d91090ce7979647 (patch)
treefbfd1bd3a744e9edee659840fb21294bd507a0a3 /ext/mysqlnd/mysqlnd_ps.c
parent4ca3468e78c78ed7f3ecb9624c0ecd3fd442790f (diff)
downloadphp-git-27120d4412a7122f27ac1fcd4d91090ce7979647.tar.gz
Fix invalid free of persistent results on error/connection loss in mysqlnd (bug 74376)
Diffstat (limited to 'ext/mysqlnd/mysqlnd_ps.c')
-rw-r--r--ext/mysqlnd/mysqlnd_ps.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c
index 2631e4a797..52a06d7615 100644
--- a/ext/mysqlnd/mysqlnd_ps.c
+++ b/ext/mysqlnd/mysqlnd_ps.c
@@ -129,7 +129,7 @@ MYSQLND_METHOD(mysqlnd_stmt, store_result)(MYSQLND_STMT * const s)
} else {
COPY_CLIENT_ERROR(*conn->error_info, result->stored_data->error_info);
stmt->result->m.free_result_contents(stmt->result);
- mnd_efree(stmt->result);
+ mnd_pefree(stmt->result, stmt->result->persistent);
stmt->result = NULL;
stmt->state = MYSQLND_STMT_PREPARED;
}
@@ -356,7 +356,7 @@ mysqlnd_stmt_prepare_read_eof(MYSQLND_STMT * s)
if (FAIL == (ret = PACKET_READ(fields_eof, stmt->conn))) {
if (stmt->result) {
stmt->result->m.free_result_contents(stmt->result);
- mnd_efree(stmt->result);
+ mnd_pefree(stmt->result, stmt->result->persistent);
memset(stmt, 0, sizeof(MYSQLND_STMT_DATA));
stmt->state = MYSQLND_STMT_INITTED;
}