diff options
| author | Heikki Linnakangas | 2014-05-06 12:14:51 +0000 |
|---|---|---|
| committer | Heikki Linnakangas | 2014-05-06 12:17:14 +0000 |
| commit | d65ecdf4110bb352527dd2f6de31421d5b769258 (patch) | |
| tree | a77eaa0dcf94ddbf9e59f555e47232b538bd1014 /src | |
| parent | 91c8c106facadc868308e90dbaca3ac6017be5f0 (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')
| -rw-r--r-- | src/backend/replication/libpqwalreceiver/libpqwalreceiver.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c index 8f1c592f48b..d2786fdf8b0 100644 --- a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c +++ b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c @@ -133,6 +133,7 @@ libpqrcv_connect(char *conninfo, XLogRecPtr startpoint) 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"), |
