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.
This commit is contained in:
Heikki Linnakangas 2015-07-27 18:27:27 +03:00
parent 334445179c
commit 61a65c53bd
1 changed files with 2 additions and 5 deletions

View File

@ -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);