summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2019-11-06 14:20:29 +0100
committerPeter Eisentraut <peter@eisentraut.org>2019-11-06 14:22:50 +0100
commita5b95016af918c0b147bb21bb52357b45f0376e9 (patch)
tree1fa78b66f1db9b225573db68efaaa26b496e6871 /src
parentf7b0d07049236b4f41e96e51f45755de294c1a54 (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')
-rw-r--r--src/backend/replication/logical/relation.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/replication/logical/relation.c b/src/backend/replication/logical/relation.c
index b849f1dc988..54bcd16ec12 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;