mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-30 19:00:29 +08:00
Fix double-free bug of WAL streaming buffer in pg_receivexlog.
This bug was introduced while refactoring in commit 74cbe96
.
This commit is contained in:
parent
74cbe966fe
commit
4ccac92d08
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user