From: Tom Lane Date: Thu, 12 Feb 2015 00:20:49 +0000 (-0500) Subject: Fix missing PQclear() in libpqrcv_endstreaming(). X-Git-Tag: REL9_5_ALPHA1~786 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f38a281a3d4a7cbcf9de2f676d44336d57b7717;p=postgresql 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. --- diff --git a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c index ddcf6b2940..19dc9efedd 100644 --- a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c +++ b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c @@ -262,6 +262,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);