Skip to content

Commit fabd8e0

Browse files
committed
Fix possible segfault
1 parent e780704 commit fabd8e0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

contrib/mmts/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)
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