postgres.git / summary / log / commit / refs

commit    734bbf2e978314cad86e1dd8fefe7f0c3f52a4ef
Author:   Tom Lane <tgl@sss.pgh.pa.us>
Date:     Thu Feb 12 00:20:49 2015 +0000
First released in: 9.5.0, 9.3.7, 9.4.2

    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.


src/backend/replication/libpqwalreceiver/libpqwalreceiver.c | 1 + 1 file changed, 1 insertion(+) 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); [parent: bcf2decdceb5]