aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_basebackup/receivelog.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/bin/pg_basebackup/receivelog.c b/src/bin/pg_basebackup/receivelog.c
index 4aa35da2fce..97a078526a3 100644
--- a/src/bin/pg_basebackup/receivelog.c
+++ b/src/bin/pg_basebackup/receivelog.c
@@ -1079,12 +1079,11 @@ CopyStreamPoll(PGconn *conn, long timeout_ms)
static int
CopyStreamReceive(PGconn *conn, long timeout, char **buffer)
{
- static char *copybuf = NULL;
+ char *copybuf = NULL;
int rawlen;
- if (copybuf != NULL)
- PQfreemem(copybuf);
- copybuf = NULL;
+ if (*buffer != NULL)
+ PQfreemem(*buffer);
*buffer = NULL;
/* Try to receive a CopyData message */