From: Fujii Masao Date: Sat, 2 Aug 2014 06:18:09 +0000 (+0900) Subject: Add missing PQclear() calls into pg_receivexlog. X-Git-Tag: REL9_4_BETA3~126 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7cf7dc759c5c23703c1ac9e2808a2a059b0b02dc;p=thirdparty%2Fpostgresql.git Add missing PQclear() calls into pg_receivexlog. Back-patch to 9.3. --- diff --git a/src/bin/pg_basebackup/receivelog.c b/src/bin/pg_basebackup/receivelog.c index d57d293735b..8f360ec3e46 100644 --- a/src/bin/pg_basebackup/receivelog.c +++ b/src/bin/pg_basebackup/receivelog.c @@ -626,6 +626,7 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline, fprintf(stderr, _("%s: unexpected termination of replication stream: %s"), progname, PQresultErrorMessage(res)); + PQclear(res); goto error; } PQclear(res); @@ -640,6 +641,8 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline, } else if (PQresultStatus(res) == PGRES_COMMAND_OK) { + PQclear(res); + /* * End of replication (ie. controlled shut down of the server). * @@ -661,6 +664,7 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline, fprintf(stderr, _("%s: unexpected termination of replication stream: %s"), progname, PQresultErrorMessage(res)); + PQclear(res); goto error; } } @@ -871,6 +875,7 @@ HandleCopyStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline, PQclear(res); goto error; } + PQclear(res); res = PQgetResult(conn); } still_sending = false;