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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy