git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 58146d3)
Fix missing PQclear() in libpqrcv_endstreaming().
2015年2月12日 00:20:49 +0000 (19:20 -0500)
2015年2月12日 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.


diff --git a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
index ddcf6b294032b41271102ed112fd78169b418783..19dc9efedd46d55bc5888e59c948fa7a30d8f034 100644 (file)
--- 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);
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /