aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/cache/relcache.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2010-01-07 20:39:45 +0000
committerRobert Haas <rhaas@postgresql.org>2010-01-07 20:39:45 +0000
commitb1ee6daf2f101613c30ff26c705e3a5797af4407 (patch)
treead7e14f21ac39db0432a99cca21266bf3b837943 /src/backend/utils/cache/relcache.c
parent50626efe0aef19fa31fd9ccf79570a24b84bbf01 (diff)
downloadpostgresql-b1ee6daf2f101613c30ff26c705e3a5797af4407.tar.gz
postgresql-b1ee6daf2f101613c30ff26c705e3a5797af4407.zip
Document why we copy reloptions into CacheMemoryContext after-the-fact.
Diffstat (limited to 'src/backend/utils/cache/relcache.c')
-rw-r--r--src/backend/utils/cache/relcache.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index bb88ab5eef7..3cb6d145b45 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.296 2010/01/05 01:06:56 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.297 2010/01/07 20:39:45 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
@@ -404,7 +404,12 @@ RelationParseRelOptions(Relation relation, HeapTuple tuple)
relation->rd_rel->relkind == RELKIND_INDEX ?
relation->rd_am->amoptions : InvalidOid);
- /* Copy parsed data into CacheMemoryContext */
+ /*
+ * Copy parsed data into CacheMemoryContext. To guard against the
+ * possibility of leaks in the reloptions code, we want to do the actual
+ * parsing in the caller's memory context and copy the results into
+ * CacheMemoryContext after the fact.
+ */
if (options)
{
relation->rd_options = MemoryContextAlloc(CacheMemoryContext,