8000 Free PQresult on error in pg_receivexlog. · larkly/postgres-docker@e158bbb · GitHub
[go: up one dir, main page]

Skip to content

Commit e158bbb

Browse files
committed
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.
1 parent 9bc1b43 commit e158bbb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/bin/pg_basebackup/receivelog.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,7 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
612612
fprintf(stderr,
613613
_("%s: unexpected termination of replication stream: %s"),
614614
progname, PQresultErrorMessage(res));
615+
PQclear(res);
615616
goto error;
616617
}
617618
PQclear(res);

0 commit comments

Comments
 (0)
0