Skip to content

Commit d65ecdf

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 91c8c10 commit d65ecdf

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
@@ -133,6 +133,7 @@ libpqrcv_connect(char *conninfo, XLogRecPtr startpoint)
133133
GetSystemIdentifier());
134134
if (strcmp(primary_sysid, standby_sysid) != 0)
135135
{
136+
primary_sysid = pstrdup(primary_sysid);
136137
PQclear(res);
137138
ereport(ERROR,
138139
(errmsg("database system identifier differs between the primary and standby"),

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