Content-Length: 267135 | pFad | http://github.com/postgrespro/postgres/commit/c890b488063e23f12b5ab01c9a6d254a034fcea2

06 Free PQresult on error in pg_receivexlog. · postgrespro/postgres@c890b48 · GitHub
Skip to content

Commit c890b48

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 e6df2e1 commit c890b48

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
goto error;
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
goto error;
871873
}
872874
res = PQgetResult(conn);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/c890b488063e23f12b5ab01c9a6d254a034fcea2

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy