1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-21 15:54:08 +03:00

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.
This commit is contained in:
Heikki Linnakangas 2014-05-12 10:17:40 +03:00
parent 9bc1b439ef
commit e158bbb6e9

View File

@ -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);