projects
/
users
/
gsingh
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
74cbe96
)
Fix double-free bug of WAL streaming buffer in pg_receivexlog.
author
Fujii Masao
<fujii@postgresql.org>
Fri, 4 Jul 2014 10:48:38 +0000
(19:48 +0900)
committer
Fujii Masao
<fujii@postgresql.org>
Fri, 4 Jul 2014 10:48:38 +0000
(19:48 +0900)
This bug was introduced while refactoring in commit
74cbe96
.
src/bin/pg_basebackup/receivelog.c
patch
|
blob
|
blame
|
history
diff --git
a/src/bin/pg_basebackup/receivelog.c
b/src/bin/pg_basebackup/receivelog.c
index 4aa35da2fce359d4e735a00ed37cb744c69ff781..97a078526a3802687db7e2551830f15e8d2b44d5 100644
(file)
--- 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 */