Add missing PQclear() calls into pg_receivexlog.

Back-patch to 9.3.
This commit is contained in:
Fujii Masao 2014-08-02 15:18:09 +09:00
parent 694fd33e23
commit b819dd7cb5

View File

@ -628,6 +628,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);
@ -642,6 +643,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).
*
@ -663,6 +666,7 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
fprintf(stderr,
_("%s: unexpected termination of replication stream: %s"),
progname, PQresultErrorMessage(res));
PQclear(res);
goto error;
}
}
@ -839,6 +843,7 @@ HandleCopyStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
PQclear(res);
goto error;
}
PQclear(res);
res = PQgetResult(conn);
}
still_sending = false;