diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2015-07-27 18:27:27 +0300 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2015-07-27 18:30:27 +0300 |
commit | 03a0a3532b47b2a634cd2700d49edc086af748a0 (patch) | |
tree | 03140de756c6ad303213f503697596b9b0d194c9 /src/backend/access/transam/xlogreader.c | |
parent | 202aea62a84135256c6aa394af2c4dbfa1700c85 (diff) |
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.c | 7 |
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); |