aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlogreader.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-07-27 18:27:27 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-07-27 18:29:31 +0300
commit61a65c53bd3e48e7ff7661a528d1791dfd956957 (patch)
tree04579b3a152768b8aca062e616d510055b5b2d9d /src/backend/access/transam/xlogreader.c
parent334445179c82ba304480ecbd00ae4237587e4baf (diff)
downloadpostgresql-61a65c53bd3e48e7ff7661a528d1791dfd956957.tar.gz
postgresql-61a65c53bd3e48e7ff7661a528d1791dfd956957.zip
Fix memory leak in xlogreader facility.
XLogReaderFree failed to free the per-block data buffers, when they happened to not be used by the latest read WAL record. Michael Paquier. Backpatch to 9.5, where the per-block buffers were added.
Diffstat (limited to 'src/backend/access/transam/xlogreader.c')
-rw-r--r--src/backend/access/transam/xlogreader.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c
index a9e926c5a28..f1b209b1ad1 100644
--- a/src/backend/access/transam/xlogreader.c
+++ b/src/backend/access/transam/xlogreader.c
@@ -126,11 +126,8 @@ XLogReaderFree(XLogReaderState *state)
for (block_id = 0; block_id <= state->max_block_id; block_id++)
{
- if (state->blocks[block_id].in_use)
- {
- if (state->blocks[block_id].data)
- pfree(state->blocks[block_id].data);
- }
+ if (state->blocks[block_id].data)
+ pfree(state->blocks[block_id].data);
}
if (state->main_data)
pfree(state->main_data);