]> granicus.if.org Git - postgresql/commitdiff
Another attempt at fixing memory leak in xlogreader.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 28 Jul 2015 06:05:46 +0000 (09:05 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 28 Jul 2015 06:09:00 +0000 (09:09 +0300)
max_block_id is also reset between reading records.

Michael Paquier

src/backend/access/transam/xlogreader.c

index f1b209b1ad1a82ac3919555208213b1595e960ed..3b5d32a5815d5d3501b262cdb2e37f47b5f78b33 100644 (file)
@@ -124,7 +124,7 @@ XLogReaderFree(XLogReaderState *state)
 {
        int                     block_id;
 
-       for (block_id = 0; block_id <= state->max_block_id; block_id++)
+       for (block_id = 0; block_id <= XLR_MAX_BLOCK_ID; block_id++)
        {
                if (state->blocks[block_id].data)
                        pfree(state->blocks[block_id].data);