diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-01-19 00:27:27 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-01-19 00:27:27 +0000 |
commit | 49a263011a3770846f612576d8d3408bc3fb8a58 (patch) | |
tree | 5c4eb6dee78264101e54f4f3dc34618c8f55a518 /src | |
parent | 2e2c4f424fceec2a5303c5f4b52f3f7cfa0f11b6 (diff) | |
download | postgresql-49a263011a3770846f612576d8d3408bc3fb8a58.tar.gz postgresql-49a263011a3770846f612576d8d3408bc3fb8a58.zip |
Fix a tiny memory leak (one List header) in RelationCacheInvalidate().
This is utterly insignificant in normal operation, but it becomes a
problem during cache inval stress testing. The original coding in fact
had no leak --- the 8.0 List rewrite created the issue. I wonder whether
list_concat should pfree the discarded header?
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/utils/cache/relcache.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index e0616b45a2f..ec9e20320d2 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.230.2.1 2005/11/22 18:23:23 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.230.2.2 2006/01/19 00:27:27 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1786,8 +1786,6 @@ RelationCacheInvalidate(void) } } - rebuildList = list_concat(rebuildFirstList, rebuildList); - /* * Now zap any remaining smgr cache entries. This must happen before we * start to rebuild entries, since that may involve catalog fetches which @@ -1796,6 +1794,12 @@ RelationCacheInvalidate(void) smgrcloseall(); /* Phase 2: rebuild the items found to need rebuild in phase 1 */ + foreach(l, rebuildFirstList) + { + relation = (Relation) lfirst(l); + RelationClearRelation(relation, true); + } + list_free(rebuildFirstList); foreach(l, rebuildList) { relation = (Relation) lfirst(l); |