git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8d6a07f)
Fix use of free in walsender error handling after a sysid mismatch.
Tue, 6 May 2014 12:14:51 +0000 (15:14 +0300)
Tue, 6 May 2014 12:17:41 +0000 (15:17 +0300)
Found via valgrind. The bug exists since the introduction of the walsender,
so backpatch to 9.0.

Andres Freund


diff --git a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
index 96f31c4c55b0cec5fbcba9d81f915fb4ef8ffa1a..88d27c7690e8ab170faaf84e32c93e01f3ba4eae 100644 (file)
--- a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
+++ b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
@@ -152,6 +152,7 @@ libpqrcv_identify_system(TimeLineID *primary_tli)
GetSystemIdentifier());
if (strcmp(primary_sysid, standby_sysid) != 0)
{
+ primary_sysid = pstrdup(primary_sysid);
PQclear(res);
ereport(ERROR,
(errmsg("database system identifier differs between the primary and standby"),
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /