1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-21 15:54:08 +03:00

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
This commit is contained in:
Heikki Linnakangas 2014-05-06 15:14:51 +03:00
parent 3a024c1104
commit 17b04a1580

View File

@ -135,6 +135,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"),