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

Commit b819dd7

Browse files
committed
Add missing PQclear() calls into pg_receivexlog.
Back-patch to 9.3.
1 parent 694fd33 commit b819dd7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/bin/pg_basebackup/receivelog.c

+5
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,7 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
628628
fprintf(stderr,
629629
_("%s: unexpected termination of replication stream: %s"),
630630
progname, PQresultErrorMessage(res));
631+
PQclear(res);
631632
goto error;
632633
}
633634
PQclear(res);
@@ -642,6 +643,8 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
642643
}
643644
else if (PQresultStatus(res) == PGRES_COMMAND_OK)
644645
{
646+
PQclear(res);
647+
645648
/*
646649
* End of replication (ie. controlled shut down of the server).
647650
*
@@ -663,6 +666,7 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
663666
fprintf(stderr,
664667
_("%s: unexpected termination of replication stream: %s"),
665668
progname, PQresultErrorMessage(res));
669+
PQclear(res);
666670
goto error;
667671
}
668672
}
@@ -839,6 +843,7 @@ HandleCopyStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
839843
PQclear(res);
840844
goto error;
841845
}
846+
PQclear(res);
842847
res = PQgetResult(conn);
843848
}
844849
still_sending = false;

0 commit comments

Comments
 (0)