Commit b819dd7c authored by Fujii Masao's avatar Fujii Masao

Add missing PQclear() calls into pg_receivexlog.

Back-patch to 9.3.
parent 694fd33e
...@@ -628,6 +628,7 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline, ...@@ -628,6 +628,7 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
fprintf(stderr, fprintf(stderr,
_("%s: unexpected termination of replication stream: %s"), _("%s: unexpected termination of replication stream: %s"),
progname, PQresultErrorMessage(res)); progname, PQresultErrorMessage(res));
PQclear(res);
goto error; goto error;
} }
PQclear(res); PQclear(res);
...@@ -642,6 +643,8 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline, ...@@ -642,6 +643,8 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
} }
else if (PQresultStatus(res) == PGRES_COMMAND_OK) else if (PQresultStatus(res) == PGRES_COMMAND_OK)
{ {
PQclear(res);
/* /*
* End of replication (ie. controlled shut down of the server). * End of replication (ie. controlled shut down of the server).
* *
...@@ -663,6 +666,7 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline, ...@@ -663,6 +666,7 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
fprintf(stderr, fprintf(stderr,
_("%s: unexpected termination of replication stream: %s"), _("%s: unexpected termination of replication stream: %s"),
progname, PQresultErrorMessage(res)); progname, PQresultErrorMessage(res));
PQclear(res);
goto error; goto error;
} }
} }
...@@ -839,6 +843,7 @@ HandleCopyStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline, ...@@ -839,6 +843,7 @@ HandleCopyStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
PQclear(res); PQclear(res);
goto error; goto error;
} }
PQclear(res);
res = PQgetResult(conn); res = PQgetResult(conn);
} }
still_sending = false; still_sending = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment