8000 Fix use of free in walsender error handling after a sysid mismatch. · larkly/postgres-docker@e0070a6 · GitHub
[go: up one dir, main page]

Skip to content

Commit e0070a6

Browse files
committed
Fix use of free in walsender error handling after a sysid mismatch.
Found via valgrind. The bug exists since the introduction of the walsender, so backpatch to 9.0. Andres Freund
1 parent fb66e88 commit e0070a6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/backend/replication/libpqwalreceiver/libpqwalreceiver.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ libpqrcv_connect(char *conninfo, XLogRecPtr startpoint)
135135
GetSystemIdentifier());
136136
if (strcmp(primary_sysid, standby_sysid) != 0)
137137
{
138+
primary_sysid = pstrdup(primary_sysid);
138139
PQclear( 4321 res);
139140
ereport(ERROR,
140141
(errmsg("database system identifier differs between the primary and standby"),

0 commit comments

Comments
 (0)
0