Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0ad7830

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 isno real leak.
1 parentc6d048c commit0ad7830

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎src/bin/pg_basebackup/receivelog.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,7 @@ HandleCopyStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
912912
if (!close_walfile(basedir,partial_suffix))
913913
{
914914
/* Error message written in close_walfile() */
915+
PQclear(res);
915916
gotoerror;
916917
}
917918
if (PQresultStatus(res)==PGRES_COPY_IN)
@@ -921,6 +922,7 @@ HandleCopyStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
921922
fprintf(stderr,
922923
_("%s: could not send copy-end packet: %s"),
923924
progname,PQerrorMessage(conn));
925+
PQclear(res);
924926
gotoerror;
925927
}
926928
res=PQgetResult(conn);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp