git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3344451)
Fix memory leak in xlogreader facility.
2015年7月27日 15:27:27 +0000 (18:27 +0300)
2015年7月27日 15:29:31 +0000 (18:29 +0300)
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.


diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c
index a9e926c5a283d81d23ea00d330a15f5e0fd0b144..f1b209b1ad1a82ac3919555208213b1595e960ed 100644 (file)
--- 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);
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /