projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b4eeb9d
)
Fix use of free in walsender error handling after a sysid mismatch.
author
Heikki Linnakangas
Tue, 6 May 2014 12:14:51 +0000
(15:14 +0300)
committer
Heikki Linnakangas
Tue, 6 May 2014 12:16:51 +0000
(15:16 +0300)
Found via valgrind. The bug exists since the introduction of the walsender,
so backpatch to 9.0.
Andres Freund
src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
index 6bc0aa1c12cdd53a14ce045ae2614dceddccc2bf..1cb2c6e524d2b17d23266275ffb4fa529f614c10 100644
(file)
--- a/
src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
+++ b/
src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
@@
-151,6
+151,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"),