mirror of
https://github.com/php/php-src.git
synced 2026-04-29 11:13:36 +02:00
Fix a leak, memory warning and failing test case.
This commit is contained in:
@@ -32,7 +32,9 @@ EOSQL;
|
||||
$stmt = $mysql->prepare("SELECT * FROM blobby");
|
||||
$stmt->execute();
|
||||
$stmt->store_result();
|
||||
$params= array_pad(array(), $col_num, "");
|
||||
for ($i = 0; $i < $col_num; $i++) {
|
||||
$params[] = &$col_num;
|
||||
}
|
||||
call_user_func_array(array($stmt, "bind_result"), $params);
|
||||
$stmt->fetch();
|
||||
|
||||
|
||||
@@ -186,6 +186,7 @@ mysqlnd_mempool_destroy(MYSQLND_MEMORY_POOL * pool TSRMLS_DC)
|
||||
/* mnd_free will reference LOCK_access and might crash, depending on the caller...*/
|
||||
mysqlnd_mempool_free_contents(pool TSRMLS_CC);
|
||||
mnd_free(pool->arena);
|
||||
mnd_free(pool);
|
||||
DBG_VOID_RETURN;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -351,8 +351,6 @@ void mysqlnd_internal_free_result_contents(MYSQLND_RES *result TSRMLS_DC)
|
||||
result->row_packet = NULL;
|
||||
}
|
||||
|
||||
result->conn = NULL;
|
||||
|
||||
if (result->meta) {
|
||||
result->meta->m->free_metadata(result->meta, FALSE TSRMLS_CC);
|
||||
result->meta = NULL;
|
||||
@@ -374,12 +372,14 @@ static
|
||||
void mysqlnd_internal_free_result(MYSQLND_RES *result TSRMLS_DC)
|
||||
{
|
||||
DBG_ENTER("mysqlnd_internal_free_result");
|
||||
|
||||
result->m.free_result_contents(result TSRMLS_CC);
|
||||
|
||||
if (result->conn) {
|
||||
result->conn->m->free_reference(result->conn TSRMLS_CC);
|
||||
result->conn = NULL;
|
||||
}
|
||||
|
||||
result->m.free_result_contents(result TSRMLS_CC);
|
||||
efree(result);
|
||||
|
||||
DBG_VOID_RETURN;
|
||||
|
||||
Reference in New Issue
Block a user