pgpool2.git / summary / log / commit / refs
commit b812e1f61d8280c81aa462af523f3815df56ec45
Author: Tatsuo Ishii <ishii@postgresql.org>
Date: Sat Oct 26 02:01:22 2013 +0000
Fix inappropriate shared memory allocation size for clock hand.
The memory for clock hand was allocated as
sizeof(pool_fsmm_clock_hand)) which is 8 bytes long because the
variable is declared as:
static int *pool_fsmm_clock_hand;
This is plain wrong. The memory size actually needed is only 4 bytes,
which is sizeof(*pool_fsmm_clock_hand)). In other word, the bug
allocated unnecessary 4 bytes, which did nothing bd for the execution
of program. But a bug is a bug.
Per covery report "1111476 Wrong sizeof argument"
src/query_cache/pool_memqcache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/query_cache/pool_memqcache.c b/src/query_cache/pool_memqcache.c
index a0eabcf8d..c8a3075f2 100644
--- a/src/query_cache/pool_memqcache.c
+++ b/src/query_cache/pool_memqcache.c
@@ -1799,7 +1799,7 @@ static int *pool_fsmm_clock_hand;
*/
void pool_allocate_fsmm_clock_hand(void)
{
- pool_fsmm_clock_hand = pool_shared_memory_create(sizeof(pool_fsmm_clock_hand));
+ pool_fsmm_clock_hand = pool_shared_memory_create(sizeof(*pool_fsmm_clock_hand));
*pool_fsmm_clock_hand = 0;
}
[parent: 996263aa3476]