]> granicus.if.org Git - postgresql/commitdiff
Fix missing PQclear() in libpqrcv_endstreaming().
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 12 Feb 2015 00:20:49 +0000 (19:20 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 12 Feb 2015 00:20:49 +0000 (19:20 -0500)
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

index 65e95c59f02f9b88cfc07b43eb88bc607e12a7d8..d101fa8c28d961474a64b8209b303b06296c499b 100644 (file)
@@ -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);