Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas2014-05-06 12:14:51 +0000
committerHeikki Linnakangas2014-05-06 12:17:41 +0000
commit3a8e9e977fa642433986e5cd145e3a6f86601c2c (patch)
tree7e1951b6d3e9d79d45785dcad78453525e4acaae /src/backend
parent8d6a07fa01cece1bd3508a81e59c0c0cbc0bb867 (diff)
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
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/replication/libpqwalreceiver/libpqwalreceiver.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
index 96f31c4c55b..88d27c7690e 100644
--- 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"),