summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-05-12 10:17:40 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-05-12 11:01:20 +0300
commite158bbb6e95afde040debf3f573fc9b60dbcf469 (patch)
tree47d614c080af5b81d8cfd11fbb8bd275cdef544b
parent9bc1b439ef8bf5cf444724c29b81cc525c020f40 (diff)
Free PQresult on error in pg_receivexlog.
The leak is fairly small and rare, but a leak nevertheless. Per Coverity report. Backpatch to 9.2, where pg_receivexlog was added. pg_basebackup shares the code, but it always exits on error, so there is no real leak.
-rw-r--r--src/bin/pg_basebackup/receivelog.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/bin/pg_basebackup/receivelog.c b/src/bin/pg_basebackup/receivelog.c
index a7a79e824a3..3a46767417e 100644
--- a/src/bin/pg_basebackup/receivelog.c
+++ b/src/bin/pg_basebackup/receivelog.c
@@ -612,6 +612,7 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
fprintf(stderr,
_("%s: unexpected termination of replication stream: %s"),
progname, PQresultErrorMessage(res));
+ PQclear(res);
goto error;
}
PQclear(res);