pgpool2.git / summary / log / commit / refs

commit    38dd7d7c769cce9e018c5eef6fe490b879ea514f
Author:   Tatsuo Ishii <ishii at sraoss.co.jp>
Date:     Sat Jan 02 09:32:24 2010 +0000

     I found what I think is a small error allocating memory in the
    make_persistent_db_connection() function in child.c. The amount of
    memory allocated is more than it should be, so it's actually harmless.
    
    Patch contributed by Xavier Noguer.


child.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/child.c b/child.c index 8e2e275aa..e2d9361f6 100644 --- a/child.c +++ b/child.c @@ -5,7 +5,7 @@ * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * - * Copyright (c) 2003-2009 PgPool Global Development Group + * Copyright (c) 2003-2010 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby @@ -1405,13 +1405,13 @@ POOL_CONNECTION_POOL_SLOT *make_persistent_db_connection( int len, len1; int status; - cp = malloc(sizeof(POOL_CONNECTION_POOL)); + cp = malloc(sizeof(POOL_CONNECTION_POOL_SLOT)); if (cp == NULL) { pool_error("make_persistent_db_connection: could not allocate memory"); return NULL; } - memset(cp, 0, sizeof(POOL_CONNECTION_POOL)); + memset(cp, 0, sizeof(POOL_CONNECTION_POOL_SLOT)); startup_packet = malloc(sizeof(*startup_packet)); if (startup_packet == NULL) [parent: 90efb9540aa7]