Skip to content

Commit 9747a98

Browse files
committed
Add missing PQclear() calls into pg_receivexlog.
Back-patch to 9.3.
1 parent 39217ce commit 9747a98

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/bin/pg_basebackup/receivelog.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,7 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
680680
fprintf(stderr,
681681
_("%s: unexpected termination of replication stream: %s"),
682682
progname, PQresultErrorMessage(res));
683+
PQclear(res);
683684
goto error;
684685
}
685686
PQclear(res);
@@ -694,6 +695,8 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
694695
}
695696
else if (PQresultStatus(res) == PGRES_COMMAND_OK)
696697
{
698+
PQclear(res);
699+
697700
/*
698701
* End of replication (ie. controlled shut down of the server).
699702
*
@@ -715,6 +718,7 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
715718
fprintf(stderr,
716719
_("%s: unexpected termination of replication stream: %s"),
717720
progname, PQresultErrorMessage(res));
721+
PQclear(res);
718722
goto error;
719723
}
720724
}
@@ -925,6 +929,7 @@ HandleCopyStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
925929
PQclear(res);
926930
goto error;
927931
}
932+
PQclear(res);
928933
res = PQgetResult(conn);
929934
}
930935
still_sending = false;

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