diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2019-11-06 14:20:29 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2019-11-06 14:22:29 +0100 |
commit | 39a6210f9e0fb3f285934f275f6dbffbc7c3fae9 (patch) | |
tree | 78163e618e166194994a49712fdb4d62faae3cad /src/backend/replication/logical/relation.c | |
parent | 9ae4bdadf79f68ec85bad38f9393b42fa69fc93a (diff) |
Fix memory allocation mistake
The previous code was allocating more memory than necessary because
the formula used the wrong data type.
Reported-by: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Discussion: https://www.postgresql.org/message-id/20191105172918.3e32a446@firost
Diffstat (limited to 'src/backend/replication/logical/relation.c')
-rw-r--r-- | src/backend/replication/logical/relation.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/replication/logical/relation.c b/src/backend/replication/logical/relation.c index 85269c037de..f938d1fa485 100644 --- a/src/backend/replication/logical/relation.c +++ b/src/backend/replication/logical/relation.c @@ -267,7 +267,7 @@ logicalrep_rel_open(LogicalRepRelId remoteid, LOCKMODE lockmode) */ desc = RelationGetDescr(entry->localrel); oldctx = MemoryContextSwitchTo(LogicalRepRelMapContext); - entry->attrmap = palloc(desc->natts * sizeof(int)); + entry->attrmap = palloc(desc->natts * sizeof(AttrNumber)); MemoryContextSwitchTo(oldctx); found = 0; |