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

Commitc890b48

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 parente6df2e1 commitc890b48

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
@@ -858,6 +858,7 @@ HandleCopyStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
858858
if (!close_walfile(basedir,partial_suffix,blockpos))
859859
{
860860
/* Error message written in close_walfile() */
861+
PQclear(res);
861862
gotoerror;
862863
}
863864
if (PQresultStatus(res)==PGRES_COPY_IN)
@@ -867,6 +868,7 @@ HandleCopyStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
867868
fprintf(stderr,
868869
_("%s: could not send copy-end packet: %s"),
869870
progname,PQerrorMessage(conn));
871+
PQclear(res);
870872
gotoerror;
871873
}
872874
res=PQgetResult(conn);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp