Skip to content
Snippets Groups Projects
Commit d213f311 authored by Peter Eisentraut's avatar Peter Eisentraut
Browse files

Fix memory allocation mistake


The previous code was allocating more memory than necessary because
the formula used the wrong data type.

Reported-by: default avatarJehan-Guillaume de Rorthais <jgdr@dalibo.com>
Discussion: https://www.postgresql.org/message-id/20191105172918.3e32a446@firost
parent cb6d7f98
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment