Content-Length: 271257 | pFad | http://github.com/postgrespro/postgres_cluster/commit/4ccac92d08f22ef0f8df29ea6bd9d5e77bf1d246

FD Fix double-free bug of WAL streaming buffer in pg_receivexlog. · postgrespro/postgres_cluster@4ccac92 · GitHub
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/4ccac92d08f22ef0f8df29ea6bd9d5e77bf1d246

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy