]> 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 ddcf6b294032b41271102ed112fd78169b418783..19dc9efedd46d55bc5888e59c948fa7a30d8f034 100644 (file)
@@ -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);