projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9bc1b43
)
Free PQresult on error in pg_receivexlog.
author
Heikki Linnakangas
Mon, 12 May 2014 07:17:40 +0000
(10:17 +0300)
committer
Heikki Linnakangas
Mon, 12 May 2014 08:01:20 +0000
(11:01 +0300)
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.
src/bin/pg_basebackup/receivelog.c
patch
|
blob
|
blame
|
history
diff --git
a/src/bin/pg_basebackup/receivelog.c
b/src/bin/pg_basebackup/receivelog.c
index a7a79e824a3912d60b07b2840c17288e1b2afc66..3a46767417eea2bc214396fab1b4da67e4c49b06 100644
(file)
--- a/
src/bin/pg_basebackup/receivelog.c
+++ b/
src/bin/pg_basebackup/receivelog.c
@@
-612,6
+612,7
@@
ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
fprintf(stderr,
_("%s: unexpected termination of replication stream: %s"),
progname, PQresultErrorMessage(res));
+ PQclear(res);
goto error;
}
PQclear(res);