Skip to content

Commit 03a0a35

Browse files
committed
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.
1 parent 202aea6 commit 03a0a35

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/backend/access/transam/xlogreader.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,8 @@ XLogReaderFree(XLogReaderState *state)
126126

127127
for (block_id = 0; block_id <= state->max_block_id; block_id++)
128128
{
129-
if (state->blocks[block_id].in_use)
130-
{
131-
if (state->blocks[block_id].data)
132-
pfree(state->blocks[block_id].data);
133-
}
129+
if (state->blocks[block_id].data)
130+
pfree(state->blocks[block_id].data);
134131
}
135132
if (state->main_data)
136133
pfree(state->main_data);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy