Skip to content
Snippets Groups Projects
Commit e158bbb6 authored by Heikki Linnakangas's avatar Heikki Linnakangas
Browse files

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.
parent 9bc1b439
No related branches found
No related tags found
No related merge requests found
...@@ -612,6 +612,7 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline, ...@@ -612,6 +612,7 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
fprintf(stderr, fprintf(stderr,
_("%s: unexpected termination of replication stream: %s"), _("%s: unexpected termination of replication stream: %s"),
progname, PQresultErrorMessage(res)); progname, PQresultErrorMessage(res));
PQclear(res);
goto error; goto error;
} }
PQclear(res); PQclear(res);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment