summaryrefslogtreecommitdiff
path: root/ext/mysqlnd
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2008-02-04 17:33:46 +0000
committerAndrey Hristov <andrey@php.net>2008-02-04 17:33:46 +0000
commit2d5e8a1e558794e68c23216a41bf2396513ce77b (patch)
tree2a9e03bd8f0ec7708cabe599272d1dd67d118557 /ext/mysqlnd
parenta547c556b64ea83456d826ed5290261e4641ccae (diff)
downloadphp-git-2d5e8a1e558794e68c23216a41bf2396513ce77b.tar.gz
Fix a leak, memory warning and failing test case.
Diffstat (limited to 'ext/mysqlnd')
-rw-r--r--ext/mysqlnd/mysqlnd_block_alloc.c1
-rw-r--r--ext/mysqlnd/mysqlnd_result.c6
2 files changed, 4 insertions, 3 deletions
diff --git a/ext/mysqlnd/mysqlnd_block_alloc.c b/ext/mysqlnd/mysqlnd_block_alloc.c
index ed6e6f7dfd..0bc85b25cc 100644
--- a/ext/mysqlnd/mysqlnd_block_alloc.c
+++ b/ext/mysqlnd/mysqlnd_block_alloc.c
@@ -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;
}
/* }}} */
diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c
index 622e4968ec..46d47893e5 100644
--- a/ext/mysqlnd/mysqlnd_result.c
+++ b/ext/mysqlnd/mysqlnd_result.c
@@ -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;