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

Commit 7694665

Browse files
committed
Fix possible segfault
1 parent 2cfd624 commit 7694665

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pglogical_receiver.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ pglogical_receiver_main(Datum main_arg)
211211
PGresult *res;
212212
MtmReplicationMode mode;
213213

214-
ByteBuffer buf;
214+
ByteBuffer buf;
215215
RepOriginId originId;
216216
char* originName;
217217
/* Buffer for COPY data */
@@ -222,6 +222,8 @@ pglogical_receiver_main(Datum main_arg)
222222
char* connString = psprintf("replication=database %s", Mtm->nodes[nodeId-1].con.connStr);
223223
static PortalData fakePortal;
224224

225+
ByteBufferAlloc(&buf);
226+
225227
slotName = psprintf(MULTIMASTER_SLOT_PATTERN, MtmNodeId);
226228

227229
MtmIsLogicalReceiver = true;
@@ -363,7 +365,6 @@ pglogical_receiver_main(Datum main_arg)
363365
resetPQExpBuffer(query);
364366

365367
MtmReceiverStarted(nodeId);
366-
ByteBufferAlloc(&buf);
367368

368369
while (!got_sigterm)
369370
{

0 commit comments

Comments
 (0)