Commit 4ccac92d authored by Fujii Masao's avatar Fujii Masao

Fix double-free bug of WAL streaming buffer in pg_receivexlog.

This bug was introduced while refactoring in commit 74cbe966.
parent 74cbe966
...@@ -1079,12 +1079,11 @@ CopyStreamPoll(PGconn *conn, long timeout_ms) ...@@ -1079,12 +1079,11 @@ CopyStreamPoll(PGconn *conn, long timeout_ms)
static int static int
CopyStreamReceive(PGconn *conn, long timeout, char **buffer) CopyStreamReceive(PGconn *conn, long timeout, char **buffer)
{ {
static char *copybuf = NULL; char *copybuf = NULL;
int rawlen; int rawlen;
if (copybuf != NULL) if (*buffer != NULL)
PQfreemem(copybuf); PQfreemem(*buffer);
copybuf = NULL;
*buffer = NULL; *buffer = NULL;
/* Try to receive a CopyData message */ /* Try to receive a CopyData message */
......
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