pgpool2.git / summary / log / commit / refs
commit 42e380138016425891044db15e80fe4ee0721fae
Author: Tatsuo Ishii <ishii at sraoss.co.jp>
Date: Fri Jul 23 06:54:34 2010 +0000
Fix do_query so that 0 out malloced area. Without this,
subsequent call to free_select_result(res) cause invalid
free() call.
pool_process_query.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/pool_process_query.c b/pool_process_query.c
index 35819aaa6..3e421b8e4 100644
--- a/pool_process_query.c
+++ b/pool_process_query.c
@@ -2760,6 +2760,7 @@ POOL_STATUS do_query(POOL_CONNECTION *backend, char *query, POOL_SELECT_RESULT *
pool_error("do_query: malloc failed");
return POOL_ERROR;
}
+ memset(res->data, 0, DO_QUERY_ALLOC_NUM*sizeof(char *));
/* send a query to the backend */
if (send_simplequery_message(backend, strlen(query) + 1, query, major) != POOL_CONTINUE)
[parent: 57566ea03b57]