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

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy