summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2015-02-11 19:20:49 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2015-02-11 19:20:49 -0500
commit0ac1fedab9e87756d13b22117f29fe4c5212da75 (patch)
treeeb28daa87d1b31af504a1a3c03eff576267dbbe9
parente44735c48821e40b2679d5b69c4d47e98ddaae6f (diff)
Fix missing PQclear() in libpqrcv_endstreaming().
This omission leaked one PGresult per WAL streaming cycle, which possibly would never be enough to notice in the real world, but it's still a leak. Per Coverity. Back-patch to 9.3 where the error was introduced.
-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 65e95c59f02..d101fa8c28d 100644
--- a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
+++ b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
@@ -252,6 +252,7 @@ libpqrcv_endstreaming(TimeLineID *next_tli)
ereport(ERROR,
(errmsg("error reading result of streaming command: %s",
PQerrorMessage(streamConn))));
+ PQclear(res);
/* Verify that there are no more results */
res = PQgetResult(streamConn);