Skip to content

Commit 4ccac92

Browse files
committed
Fix double-free bug of WAL streaming buffer in pg_receivexlog.
This bug was introduced while refactoring in commit 74cbe96.
1 parent 74cbe96 commit 4ccac92

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/bin/pg_basebackup/receivelog.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,12 +1079,11 @@ CopyStreamPoll(PGconn *conn, long timeout_ms)
10791079
static int
10801080
CopyStreamReceive(PGconn *conn, long timeout, char **buffer)
10811081
{
1082-
static char *copybuf = NULL;
1082+
char *copybuf = NULL;
10831083
int rawlen;
10841084

1085-
if (copybuf != NULL)
1086-
PQfreemem(copybuf);
1087-
copybuf = NULL;
1085+
if (*buffer != NULL)
1086+
PQfreemem(*buffer);
10881087
*buffer = NULL;
10891088

10901089
/* Try to receive a CopyData message */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy