pgpool2.git / summary / log / commit / refs

commit    70f4e3203c8e2933d965dc0395e35c1c02fec53d
Author:   Tatsuo Ishii <ishii@postgresql.org>
Date:     Fri Jul 11 01:30:07 2014 +0000

    Fix pool_handle_query_cache() to not pfree NULL pointer.


src/query_cache/pool_memqcache.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/query_cache/pool_memqcache.c b/src/query_cache/pool_memqcache.c index 1a941a1be..066911945 100644 --- a/src/query_cache/pool_memqcache.c +++ b/src/query_cache/pool_memqcache.c @@ -3,7 +3,7 @@ * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * - * Copyright (c) 2003-2013 PgPool Global Development Group + * Copyright (c) 2003-2014 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby @@ -3108,8 +3108,10 @@ void pool_handle_query_cache(POOL_CONNECTION_POOL *backend, char *query, Node *n { pool_error("ReadyForQuery: pool_commit_cache failed"); } - pfree(oids); - pfree(cache_buffer); + if (oids) + pfree(oids); + if (cache_buffer) + pfree(cache_buffer); } pool_shmem_unlock(); POOL_SETMASK(&oldmask); [parent: 91dcb630ec0a]