aboutsummaryrefslogtreecommitdiff
path: root/src
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
commit734bbf2e978314cad86e1dd8fefe7f0c3f52a4ef (patch)
treeef116f72d58f87ede6eeac1583b91c599f42ac52 /src
parentbcf2decdceb542efb2e55db2dc803b72c2e4cb5c (diff)
downloadpostgresql-734bbf2e978314cad86e1dd8fefe7f0c3f52a4ef.tar.gz
postgresql-734bbf2e978314cad86e1dd8fefe7f0c3f52a4ef.zip
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.
Diffstat (limited to 'src')
-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 1cb2c6e524d..2b0b292f666 100644
--- a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
+++ b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
@@ -246,6 +246,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);