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

Commit 7cf7dc7

Browse files
committed
Add missing PQclear() calls into pg_receivexlog.
Back-patch to 9.3.
1 parent 38803d8 commit 7cf7dc7

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
@@ -626,6 +626,7 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
626626
fprintf(stderr,
627627
_("%s: unexpected termination of replication stream: %s"),
628628
progname, PQresultErrorMessage(res));
629+
PQclear(res);
629630
goto error;
630631
}
631632
PQclear(res);
@@ -640,6 +641,8 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
640641
}
641642
else if (PQresultStatus(res) == PGRES_COMMAND_OK)
642643
{
644+
PQclear(res);
645+
643646
/*
644647
* End of replication (ie. controlled shut down of the server).
645648
*
@@ -661,6 +664,7 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
661664
fprintf(stderr,
662665
_("%s: unexpected termination of replication stream: %s"),
663666
progname, PQresultErrorMessage(res));
667+
PQclear(res);
664668
goto error;
665669
}
666670
}
@@ -871,6 +875,7 @@ HandleCopyStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
871875
PQclear(res);
872876
goto error;
873877
}
878+
PQclear(res);
874879
res = PQgetResult(conn);
875880
}
876881
still_sending = false;

0 commit comments

Comments
 (0)