pgpool2.git / summary / log / commit / refs
commit f9a4c92bb653c9b9e907ac5ccd34987ff6ffe569
Author: Tatsuo Ishii <ishii@postgresql.org>
Date: Fri Apr 20 06:41:17 2012 +0000
Fix double free/memory corruption error when:
1) on memory query cache enabled.
2) BEGIN;
3) hit ^D from psql
pool_process_query.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/pool_process_query.c b/pool_process_query.c
index 0bb9c2a85..3a82c393f 100644
--- a/pool_process_query.c
+++ b/pool_process_query.c
@@ -1375,6 +1375,11 @@ static int reset_backend(POOL_CONNECTION_POOL *backend, int qcnt)
if (cache)
{
pool_discard_temp_query_cache(cache);
+ /*
+ * Reset temp_cache pointer in the current query context
+ * so that we don't double free memory.
+ */
+ session_context->query_context->temp_cache = NULL;
}
return 1;
[parent: ce612806c703]