Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d40abd5

Browse files
committed
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
1 parent 5b7ba75 commit d40abd5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/replication/logical/relation.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ logicalrep_rel_open(LogicalRepRelId remoteid, LOCKMODE lockmode)
267267
*/
268268
desc = RelationGetDescr(entry->localrel);
269269
oldctx = MemoryContextSwitchTo(LogicalRepRelMapContext);
270-
entry->attrmap = palloc(desc->natts * sizeof(int));
270+
entry->attrmap = palloc(desc->natts * sizeof(AttrNumber));
271271
MemoryContextSwitchTo(oldctx);
272272

273273
found = 0;

0 commit comments

Comments
 (0)