From: Tatsuo Ishii Date: Tue, 10 Sep 2024 10:20:03 +0000 (+0900) Subject: Fix resource leaks in pool_memqcache.c. X-Git-Tag: V4_2_20~22 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=3db8853b646829f25aea14a80a371da114c140b3;p=pgpool2.git Fix resource leaks in pool_memqcache.c. 6fdba5c33 These leaks were brought in by commit 6fdba5c33 " Use psprintf() instead of snprintf()." Since the commit was backpatched through 4.1, this needs to be backpatched through 4.1 too. Per Coverity (CID 1559736). Backpatch-through: 4.1. --- diff --git a/src/query_cache/pool_memqcache.c b/src/query_cache/pool_memqcache.c index 0f93557ec..f42dd6485 100644 --- a/src/query_cache/pool_memqcache.c +++ b/src/query_cache/pool_memqcache.c @@ -1855,6 +1855,7 @@ pool_invalidate_query_cache(int num_table_oids, int *table_oid, bool unlinkp, in return; } } + pfree(path); if (pool_is_shmem_cache()) { @@ -1886,6 +1887,7 @@ pool_invalidate_query_cache(int num_table_oids, int *table_oid, bool unlinkp, in ereport(DEBUG1, (errmsg("memcache invalidating query cache"), errdetail("failed to open \"%s\". reason:\"%m\"", path))); + pfree(path); continue; }