diff options
author | Andres Freund <andres@anarazel.de> | 2016-03-06 16:27:20 -0800 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2016-03-06 16:27:20 -0800 |
commit | 5d1826fe76e9c82ec938edf054c2e3de52f5285c (patch) | |
tree | b34669801da2fb0e7b8e979829baa678fe0fea21 /src/backend/replication/logical/reorderbuffer.c | |
parent | c2d61adc32fe0f91b735f85263ecdd82589dba80 (diff) |
Fix wrong allocation size in c8f621c43.
In c8f621c43 I forgot to account for MAXALIGN when allocating a new
tuplebuf in ReorderBufferGetTupleBuf(). That happens to currently not
cause active problems on a number of platforms because the affected
pointer is already aligned, but others, like ppc and hppa, trigger this
in the regression test, due to a debug memset clearing memory.
Fix that.
Backpatch: 9.4, like the previous commit.
Diffstat (limited to 'src/backend/replication/logical/reorderbuffer.c')
-rw-r--r-- | src/backend/replication/logical/reorderbuffer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c index a04d8ec6e63..40d5c4833c2 100644 --- a/src/backend/replication/logical/reorderbuffer.c +++ b/src/backend/replication/logical/reorderbuffer.c @@ -483,7 +483,8 @@ ReorderBufferGetTupleBuf(ReorderBuffer *rb, Size tuple_len) { tuple = (ReorderBufferTupleBuf *) MemoryContextAlloc(rb->context, - sizeof(ReorderBufferTupleBuf) + alloc_len); + sizeof(ReorderBufferTupleBuf) + + MAXIMUM_ALIGNOF + alloc_len); tuple->alloc_tuple_size = alloc_len; tuple->tuple.t_data = ReorderBufferTupleBufData(tuple); } |